Search Unity

Feedback Rigging Bone Rolling Question

Discussion in 'Animation Rigging' started by Apocraphilia, Oct 20, 2019.

  1. Apocraphilia

    Apocraphilia

    Joined:
    Oct 31, 2012
    Posts:
    3
    Firstly, very excited about the new Rigging machinery - decided to try it out on a new prototype, and I'm very excited with the initial results. Thanks for the cool new package.

    I am experiencing one odd artefact, though, that I was hoping someone might have some tips on...

    I'm using the Two-Bone IK constraint on the leg of a prototype model I built in Blender. Here's the first bone of the leg in question - oriented Z-upwards, from the looks of things (and the mesh aligned on it as I expected.)

    1.PNG

    I'm driving the constraint's IK Target around so the 'foot' sits on the surface behind, and as I said, the IK translation works beautifully.

    The awkward thing is, that first bone (and the second one too, actually) is rolled over 90 degrees, taking the mesh with it. (The bone's Z is going back into the scene, X pointing down.) This happens instantly, as soon as the IK starts acting.

    2.PNG

    What I find *particularly* weird is... if I max out the IK (move the IK Target beyond where the bones can reach to) it snaps 'correct' again (Z-upwards.)

    3.PNG

    My knowledge on this stuff is limited, but my intuition is that there's some kind of 'rotation aiming' in the Two-Bone IK constraint, that isn't playing nice with my setup. My first guess is that it might be orienting based on the rotation of the IK Target, but tweaking that didn't help... same deal with my other suspected culprit, the constraint's IK Hint. I also tried rotating the bone in Blender (which I felt sure would solve the problem) but no love there, either. Even experimenting with assigning a rotation of my own via a Rotation constraint didn't seem to help (although they seemed to operate globally, not locally, so I never did get them to act like I wanted.)

    If if anyone has any ideas, it'd be lovely to find what's causing this effect. Thanks. :)
     
  2. Jebtor

    Jebtor

    Unity Technologies

    Joined:
    Apr 18, 2018
    Posts:
    115
    Hey, first of all thank you for your very detailed post :)

    I can see why such a roll is an undesired behavior for your setup. I suspect that your issue will be solved if you alter the bindpose in blender slightly. Currently, your two bones are completely straight. This makes it hard for the constraint to figure out how it is supposed bend. Ideally we would improve this at some point.

    Try rotating the lower bone slightly in the way you expect the chain to bend during runtime. This would be the z-axis if I am not mistaken and your axis for both bones are the same. Instead of a straight line your leg will now form a triangle. This will help the constraint bend in the right direction when it is activated. Overall, it is a good idea to have a hint for your two bone IK as it will result in a more stable solve and provide more control.

    Please let me know if this helps. If you keep on having issues it would be helpful if you could file a bug report
     
    Apocraphilia likes this.
  3. Apocraphilia

    Apocraphilia

    Joined:
    Oct 31, 2012
    Posts:
    3
    I... holy crap, that worked *perfectly* - @ssantema, I owe you a beer. :)