Home Website Youtube GitHub

Non Planar Joint Chains and Components

I’ve often have to build rigs that have slightly non-planar IK chains and in the past, I’ve been able to do that in other rigging frameworks and have predictable results as long the model isn’t way off and I’d be sending it back to the client. With mGear it’s always caused problems. I’ve been able to get this fixed for the leg_3jnt_01 component by simplifying the addChain2D method so joint orients are maintained and the intended positions are not correct after the joint orient update.

Instead of building planar vectors from the input positions to set the joint orient, just calling makeIdentity(jnt, rot=1) is enough to push the rotations in the joint.

My question is… If it’s the guide that ensures that the input positions are planar, why should the method enforce this? I’ve built a few rigs now with this change to test and it doesn’t look like it breaks anything so far. So I can choose to tweak a chain by unlocking the guides channels.

Is it intended that prim.addChain2D is always planar? Should I add a new method “addChain3D” or similar? It seems the safest option. I’m curious if others face this problem often where you can’t get a perfect model to build a rig from too.

There is another slight fix to get the components working, but that is related to the twist offset calculation, when joints are non-planar the way the switch is calculated needs updating. But that fix should work for all scenarios.