5
$\begingroup$

I am making a rig that transfers motion from one mesh to another via bones. This is for complex mesh hair strands. The base mesh has a cloth sim on it. Chains of bones are constrained to follow this mesh. Another version of the mesh is then driven by this bone armature.

It works by IK constraining the tips of bones to vertices. Their roots are locked by being Connected to the bones high up the chain. Each strand has 5 vertical loops. There are 3 bone chains per strand, on the edge and center loops.

This picture shows the armature and the mesh it is driving, but not the mesh the armature is constrained to. enter image description here

All areas of this rig are working, but I am getting strange behavior in some parts. In some areas, mostly at the tips, there is twisting in the mesh being controlled by the armature. It appears to be twisted by 180 degrees. Currently, I can solve it by manually selected the three bones that converge at the tip, and then rotating them by 180 degrees on their local Y. enter image description here

I would like to remove this twisting. I do not understand where it could be coming from. Inherit rotation is disabled on all bones. I've tried changing the bone's rotation mode off Quaternion, but it makes no difference. This rig works entirely by copying location, not rotation, so I do not see how there could actually be any rotation data on the bones (there is none to reset.) Removing weights from the side bones does not help. I can only conclude that the bones are fine, but the mesh is somehow flipping? What could cause this?

EDIT: Here's a link to the file. It's a .zip because it also contains the .mdd needed for it. Apparently those cannot be packed into the blend file. Load it into the Mesh Cache modifier.

https://www.dropbox.com/s/ki3slubwrpb1j9r/HairRigTwistingProblem.zip?dl=0

EDIT 2: I have found a workaround. If I make a vertex group of the loop that runs horizontal across the tail that is at the top of the last bones in the chains, and give them copy rotation to that vertex group, it seems to fix the problem. I may have to pursue this workaround as the full solution, but it does not explain what's going on in the first place.

$\endgroup$

1 Answer 1

3
+50
$\begingroup$

The problem is 3 chains per hair strand combined with that you skipped many segments an created long bones over them, so the bones cannot follow the mesh strand exactly. They try their best to fit the shape, but this results in twisting at the tip:

enter image description here

The 2 side chains are redundant. Build only 1 chain but for every segment and set the bones like this so they rotate with the mesh:

enter image description here

You cannot notice any folding in the strands anyway, you will hardly see any difference.

If you really want to copy the motion exactly, rather than setting up 3 chains for each strand segmented like crazy write a script that will generate disconnected bones on every face and constrain each to that particular face with a Child Of with vertex group of that face. Child Of Constraint Set Inverse with Python

Also this simulation is not very high quality, the mesh oscillates with high frequency and you can see some nasty artifacts (but that does not cause the problem)

In the armature modifier check Preserve Volume (that does Quaternion skinning which you want)

$\endgroup$
4
  • $\begingroup$ @drudge, this is the answer, but if you need three bones per hair strand, I suggest adding a root bone at the base of each segment. $\endgroup$
    – ruckus
    Commented Apr 30, 2015 at 16:42
  • $\begingroup$ The three bones are necessary because it is possible for the strands to crumple and fold in some areas. This isn't softbody, it's a high quality cloth sim out of Marvelous Designer. So I do need to be able to capture the behavior of more than one look. In what way are they twisting it through weights? Even if I unpaint the 2 side bones at the tip and give full strength to the middle bone, I still get this twisting. @VinceScalia What would be the purpose of the root bone in this case, and how should it be set up? $\endgroup$
    – Ascalon
    Commented Apr 30, 2015 at 20:16
  • $\begingroup$ You are correct, I should have said high point density, not high quality, as this is only quick preview quality, and I purposely put it through a lot of nasty twists, tears, and clipping as I wanted to test the worst case scenario. I am going to try it with a single bony chain and copy Rot as you suggest. Thanks! $\endgroup$
    – Ascalon
    Commented May 1, 2015 at 1:45
  • $\begingroup$ I'm trying to implement this answer, but I'm having problems with the Copy Rotation. See here: blender.stackexchange.com/questions/30412/… $\endgroup$
    – Ascalon
    Commented May 6, 2015 at 23:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .