Sunday, August 31, 2014

Twist Distribution Method

I've been experimenting with twist distribution lately in my rigs to get nice deformation. This is crucial in CG because a rig without good deformation is like a bad drawing. And in CG a bad drawing doesn't even have a childlike charm. It just look like someone put a magnet too close to the computer.

There are a bunch of methods for twist distribution. You can do it with locators, expressions, constraints, or math nodes. One method on Creative Crash got my attention. It uses an IK Handle to prevent one joint from twisting, and then you can apply your twist distribution down the line. Then someone in the comments pointed out a better way to do it using math nodes instead of a locator & constraint. But going back and forth between the comment and tutorial itself can be annoying, and the guy in the comments doesn't include pictures, so I've created a condensed explanation. The original tutorial is here:
http://www.creativecrash.com/maya/tutorials/character/c/advanced-non-flipping-upper-arm-roll

First create a normal IK Chain arm or leg. Then attach the deform chain roll joints to the shoulder or, in the case of a quadruped, to the torso. Apply an RP IK to the first roll joint and zero out the pole vector so it won't twist.
Then create two Multiply/Divide nodes with the operation set to "Multiply" and the 2X value set to -1. Plug rotate x of the bind bone (the one that is part of the twist-distribution system) into the first Multiply/Divide node, on input 1X. Then plug the rotate X of the driver bone into Input 1X on the second Multiply/Divide node.

Then create a Plus/Minus/Average node, set the operation to "Subtract" and attach the bind bone Output X into input 1D[0] and the driver Output X into input 1D[1]. Now attach the output of the Plus/Minus/Average node into a new Multiply/Divide node, into both input 1X and 1Y. Then divide each of those numbers by whatever value you think will create good twist distribution. I chose 3 for Input 2X and 6 for Input 2Y. Then plug Output X into the first bone that will twist, and Output Y into the second bone that will twist. If you have more twist bones, create more Multiply/Divide nodes as needed.

The node network will look like this:

The bones in the viewport look like this:

If anybody reads this and has questions/suggestions, leave a comment. This is far from the only way to do twist distribution, but it's a method I've found to work.




No comments:

Post a Comment