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 Two-bone IK with twist correction?

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

  1. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    3,202
    I've set up Two-bone IK, and that works fine:

    upload_2020-7-9_2-6-27.png

    I've also independently set up Twist Correction, since basic rotation of the hand looks bad if it doesn't also apply some rotation to the forearm:

    upload_2020-7-9_2-7-22.png



    However, if both of these are enabled at the same time, I get garbage results:

    upload_2020-7-9_2-8-35.png

    Is it possible to correct bad hand twist behavior using Twist Correction on bones that are part of an IK system? So far it seems I either need to choose between convenient IK, or good looking twist behavior.
     
  2. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    698
    This might be your rig order. The Twist rig should come after the IK rig, or if it's one rig then the hierarchy of the constraints needs to be changed to match the same setup.
     
  3. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    3,202
    I've tried it in various ways, with IK before Twist, and vice versa, everything in one rig, the two constraints in separate rigs, but the results are the same in each case. I'll keep testing to see if there's something off about my approach.
     
  4. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    3,202
    It seems the issue is probably that 2-bone IK already does some twist correction. Looking at this more closely, rotating the hand also applies what looks like 50% of that rotation to the forearm. So, my bad setup resulted in two constraints trying to do twist correction, more or less.

    The downside fo 2-bone IK's correction is that it doesn't allow for other bones to be included. I have an additional "twist" bone on my rig that I'd like to be able to manipulate along with the forearm's twist. But maybe I can fuse 2-bone IK together with Twist Correction and make a custom constraint that sort of does both things.
     
  5. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    698
    They shouldn't override each other, they should work together. If you take a look at the Ninja character sample they made you can see a proper setup and it working correctly.

    https://github.com/Unity-Technologies/animation-rigging-workshop-siggraph2019

    If you don't want to look at the whole project you can check out the PDF included on how to set up a full rig
    https://github.com/Unity-Technologi...raph2019_unity_animation_rigging_workshop.pdf

    The twist bone setup is at the end if you want to just skip to that. It's under Setting Up the Deform Rig
     
  6. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    3,202
    Cool. I'll take a look at the demo and see what I'm doing wrong in my project.
     
  7. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    3,202
    I downloaded the project and took a look at what they were doing. They indeed have both 2-bone IK along with Twist Correction on each of the ninja's limbs. However (and here's where I messed up) their Twist Correction only modifies "Twist" bones, rather than the standard rig bones.

    "Twist" bones are new to me. They don't cause the bone to rotation, they just move the mesh around to improve how things look when nearby bones rotate. In my case, I was trying to IK and Twist the exact same bone, while in this demo the IK and Twist affect different bones.

    So, for now, I'll continue to assume that I shouldn't be using Twist Correction on the same bones that are being moved by IK, but I can use it on the 'twist" bones in my model. Not all models have twist bones, though. It's something the 3D artist would need to build into it.
     
    iulia1393 likes this.
  8. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    698
    Yea, twits bones are something that needs to be added before you can utilize them. Most people don't rig with them but they are needed in order to get a somewhat realistic rotation for limbs and other organic models (rigged) and not using muscle deforms etc for High-quality cinematic rigs.
     
unityunity