Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. We are looking for feedback on the experimental Unity Safe Mode which is aiming to help you resolve compilation errors faster during project startup.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Help Wanted ChainIK for fingers?

Discussion in 'Animation Previews' started by dgoyette, Jul 8, 2020.

  1. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    3,202
    I was curious whether people were using Animation Rigging to fine-tune finger placement using a ChainIK constraint? I tried it out a bit tonight, and found that the results a little unstable (the finger would bend awkwardly at the second knuckle in cases where a normal person would bend at the first knuckle; joints would bend backwards in some cases (seems there's no Hint option here?)), but those might have been at extreme positions. In many other cases, the finger worked pretty well.

    What I don't know is whether having 10 Chain IK constraints on the model is an issue for performance. Is Chain IK a recommended approach to animating fingers? Is there some other constraint that makes more sense? Or is this asking for a bit too much, and I should just animate fingers with key-frames, the old fashion way?
     
  2. danUnity

    danUnity

    Joined:
    Apr 28, 2015
    Posts:
    66
    I have the same questions as you do!
     
  3. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    3,202
    Playing around with this a bit more, it seems that a multi-rotation constraint feels better for fingers. I added two constraints, so that bone1 and bone2 of the finger are constrained by bone3's rotation. So now rotating the finger tip causes the rest of the finger joints to rotate. This seems pretty good to me. Usually with fingers, I just want all the bones to rotation together, so actual IK doesn't seem necessary.
     
  4. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    698
    The Twist Chain Constraint might be the one for fingers.
     
  5. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    3,202
    I don't see a constraint with that name. It sounds like you might be combining two constraints: Chain IK, and Twist Correction. I don't think Twist Correction is appropriate here, since the fingers don't twist, and Chain IK seems to be overkill (and a bit messy, per my first post).

    I'm more inclined to conclude that Multi-rotation is the right choice here. Fingers bending is very similar to the example project's "mRotation" scene, which has a buy bending over, where you just rotate his head to get rotation of several of his spine bones at the same time. Unless someone wants to correct me, I think this is what I'll use for the finger bones.
     
  6. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    698
    Ah, I should have asked you which version you are using. Maybe it's a new constraint for Unity 2020.1 forward but it's an actual constraint.
    upload_2020-7-9_0-12-18.png
     

    Attached Files:

  7. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    3,202
    Ah, neat. And good call, I'm on 2019.4, and I don't have the option of using 2020.1, so I'll have to make due with the multi-rotation I guess. Thanks for mentioning it though.
     
    Grimreaper358 likes this.
  8. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    3,202
    I figured I'd mention, I don't know why I was overthinking things initially, but 2-bone IK is actually fine for fingers. I probably was thinking "Fingers have three bones, so I can't use two-bone IK". But 2-bone IK performs IK on two bones in response to changes to a 3rd bone. So, in the case of fingers, you can just plug in the three finger bones:

    upload_2020-7-11_11-28-46.png

    What I still don't know is whether there are any performance considerations to using a lot of rigs and constraints, or whether this is all such efficient jobified code that it doesn't matter. We'll see.
     
  9. danUnity

    danUnity

    Joined:
    Apr 28, 2015
    Posts:
    66
    Ah that's a cool solution! Interesting! Thanks for sharing! I'm curious about the performance too!
     
unityunity