Sometimes, cloth has to follow the body only when being squished by it. Rigging it directly to a bone would make it unnaturally follow it when the cloth is not actually being squished!
Tutorial
What you need
Basic Blender knowledge: Modifying meshes, and managing of blendshapes
The
VRM addon for Blender
Steps
In Blender
Import your model into Blender, and, for your own sanity,
properly separate the piece of cloth you want to be squished from the rest of the clothes.
d898cf09-18dd-4bb5-aa46-96bb68c9398e-image.png
Rotate the bone to its humanly possible limit. In this case, any rotation of the neck bone in the X axis greater than 5° caused clipping, but I increased the rotation to something that looks like a reasonable limit for neck rotation.
Take note of all the angles you work with, in this case, 5° and 22°.
6cf2dbf8-4b68-45a9-bbba-10ca167a01ba-image.png
Select your mesh, and create a new blendshape. Name it something descriptive, in this case, it's Neck Forward. Modify this blendshape such that the cloth no longer clips in the set bone position.
9f6f5dc7-a3a4-4d7c-af8b-e508748a168d-image.png
(Optional) In this case, when rotating the neck in the Y axis, the cloth looks very unnatural. Since it's a common movement, you can create two additional blendshapes for each side that will activate along with the first one, blending and making the cloth follow the chin a bit better. I called these blendshapes Neck Left and Neck Right.
63a9f602-e191-46f1-a008-a7abed8ceb6f-image.png
3ed47cfe-32bd-40c0-b509-7199f1535814-image.png
c35c6581-74c0-4fd4-a619-436926d2d696-image.png
Now put the bones in the rest position, reset the blendshapes, and
register the new blendshapes in the VRM blendshape proxy so VNyan can read them.
84aec080-2c70-4654-94ae-dee5012b3708-image.png
Export the model
In VNyan
We now have to setup VNyan to check the neck rotation every frame, and if it's beyond the 5° rotation on the X axis, start activating the blendshape, blending it until the 20° limit, when Neck Corrective Down should be at its maximum.
10c93063-f340-4f84-9d6c-1049771049a1-image.png
Here's a quick breakdown of the node setup:
This part just sets up a loop for vnyan to run every frame
52f8f060-b872-40c2-9ea4-0854bcd789f4-image.png
Next, it gets the value for the X rotation
600d9a7d-484d-47a9-9290-3193bbed164f-image.png
And checks that it is between the 5° and 22° range. If it passes, it sets the new blendshape value.
984b0df0-03ab-46b7-b836-9c15967ec30c-image.png
The value for the blendshape is determined via a linear interpolation that maps de 5°-22° range to the 0-100 range. If your range goes from a to b, you have to substract b to make it go from 0 to a-b, and then multiply it by 100/(a-b), making the range go from 0 to 100. Here, a=5 and b=22
1cc783e6-4b4c-4b1e-b40a-4c171393c950-image.png
(Optional) You can use the ordered execution node to make it also check the Y axis and apply the other two blendshapes as needed. You can just define the angle limits by what angles you used in blender while setting up the blendshapes.
Don't take this screenshot too seriously, I didn't properly note the angles I used so I just guessed numbers, but it gives a general idea of the process of checking another angle along with the first one.
4102e0ae-a06b-4002-9f10-c9279cdb9050-image.png
And so, every frame the blendshape values are updated smoothly between 0 and 100 depending on the neck rotation, squishing the cloth as needed!
b7b93bf5-ee21-4e9d-bce1-5fc7a6971c1b-image.png
Notes
You can do this for a bunch of bones, use the three axis of rotation, and mix and match conditions to suit your desires. It may even start to look like a Live2D setup. Be careful though,
you roughly duplicate the amount of blendshapes needed by each degree of freedom! Two bones can need up to 64 blendshapes, one for each possible range of positions!
This can probably be done in Warudo too!
Files
The node setup for a single axis
No sample file or model today, this is my
friend's model (
Go take a look at her work if you can understand spanish!)