Rigging Characters for Animation, Pt. 1, From New Riders | 9 | WebReference

Rigging Characters for Animation, Pt. 1, From New Riders | 9

'; figDoc.write(zhtm); figDoc.close(); } // modified 3.1.99 RWE v4.1 -->

Inside Maya: Rigging Characters for Animation. Pt. 1.

    7. Next, open the Connection Editor, load the curveInfo node in the left side, and load the multiplyDivide node on the right.

    8. Figure out which axis is pointing down your joint hierarchy so that when you scale your joints, they scale along the axis that is pointing toward the next child joint. This determines which attributes you connect in the next step. For this example, if you used the default xyz for the Orient Joint command, the axis you need to use to connect will be the X axis (see Figure 17.22).

    Figure 17.22
    Connecting the curveInfo node with the Orient Joint command.

    9. Connect the arcLength attribute of the curveInfo node to the multiplyDivide node's input1 attribute. Be sure to use the axis (X, Y, or Z) that your joint should scale along—you took note of this in the last step. For this example, use input1X.

    10. Now look at the number that is in the multiplyDivide node's input1 attribute (by looking at the yellowed number in the Attribute Editor). In this case, it is 66.637. This is the output value of the arcLength, which returns the current length of your spline IK curve's length. If the spline's curve length changes (by pulling CVs or deforming it in some way), this arclen node will continue to update the curve length and feed the current new distance into the multiplyDivide node.

    Now you want to create a normalized ratio that represents the amount that the curve length is scaling (if a CV of the curve gets moved) to drive the scale attribute of each joint in the hierarchy. This is easily achieved by dividing the current distance (the yellow one) by the initial distance before the deforming took place. So, as common sense would dictate, the output at the default state always equals a scale of 1. The curve has not yet been deformed, so the current distance just happens to also be exactly what you need for the initial distance.

    11. Copy/paste the attributes from the yellow input attribute of your multiplyDivide node (the curve's current length) into the corresponding input2 channel directly below in the Attribute Editor for the correct division action to take place.

    This results in a value that will represent the amount by which the joint's length should be changed to approximate the curve's current length. You can then simply use this to drive the scaleX attribute of each joint (see Figure 17.23).

    Figure 17.23
    Resulting value that represents the length that the joints will be changed to.

    12. Open the Connection Editor again, load the multiplyDivide node on the left and the joints on the right, and then connect the multiplyDivide node's division outputX attribute into each joint's scaleX. Skip the very last joint in the hierarchy (the bottommost child at the tip). Because it is the very last end joint, it doesn't need to have any scale attached (see Figure 17.24).

    Figure 17.24
    In the Connection Editor, connect the multiplyDivide node's division outputX attribute into each joint's scaleX.

    Now you will create a second skeleton hierarchy. This will be the low-res, control joint hierarchy that controls all the high-res spine's motion through a series of binding and weighted pole vector constraints. Usually about four to six joints will do just fine for this low-res hierarchy.

    13. Create the joints, and make sure they are spaced evenly and are placed in the locations that you want the back to pivot and bend from. Also make sure that they are placed directly on top of the spline IK curve by using the Joint tool with holding down the c key; this activates Curve Snapping mode while drawing your joints directly on top of the spline IK curve. Make sure that the new low joint count hierarchy that you just built has the same start position as the spline IK's root and has a similar end position as the very last child joint in the spline IK hierarchy.

    14. Make sure you are happy with the orientation and placement of your new low-res joint hierarchy; reorient these new low-res spine joints, if necessary. Click Modify, Prefix Hierarchy Names to rename this new joint hierarchy with the prefix lowRes_Control_ (see Figure 17.25).

    Figure 17.25
    Rename the low-res joint hierarchy.

    15. Now select the spline curve and Shift+select the lowRes joint hierarchy's root. Smooth-bind the curve to the lowRes joint hierarchy.

    16. Test how the low-res joint hierarchy bends your spline IK setup so far. If you are unhappy with the arc or curve of the bend, hit Undo (the z key) a few times until you are back to the point where you can start rebuilding your low-res joint hierarchy. Do this test a few times until you get the right placement and number of joints for your low-res joint hierarchy (see Figure 17.26).

    17. Next, even out the weighting of your smooth bound curve by distributing the curve's CV weights more evenly across the joints. Do this by selecting the CVs of the curve and using the Smooth Skins tab under General Editors, Component Editor. Modify the weights by changing some of the values at 1 to .5, or .75, depending on how close they are to the neighboring joint (see Figure 17.27).

    Figure 17.26
    Testing the low-res joint hierarchy on the spline IK setup.

    Figure 17.27
    Using the Component Editor to modify the weights.

    Now the problem you have is that the spline IK hierarchy bends and compresses really nicely, but it doesn't twist (due to the nature of the spline IK solver's pole vector ). Although the spline IK solver has a rotation plane implemented and is controllable by using the twist attribute, you don't want to use this attribute to drive the twisting of the spine—it will violate the intuitive control that an animator expects to have when he rotates one of the single joint controls of the low-res skeleton. At this point you really need a rotate plane at every single joint, which has a weighted average to control the twisting of the spine based on the twisting of the low-res control joints. Unfortunately, the spline IK allows only a single rotate plane that is distributed evenly over the entire hierarchy.

    So, in the following steps you will create yet one more hierarchy of joints. This time it will be an exact duplicate of the spline IK hierarchy—but without the spline IK and with a weighted pole vector–constrained ikRPsolver IK handle at every single joint.

    18. Select the root joint of the original spine's spline IK joint hierarchy and duplicate it using the default duplicate options. Delete the unused effector node in the new duplicated hierarchy, which got duplicated from the other spline hierarchy. (Make sure you delete only the effectors of the duplicated hierarchy, not the effector that the IK spline solver is connected to.)

    19. Click Modify, Prefix Hierarchy Names to rename this duplicated hierarchy to have a new prefix of Ik_Bind_Spine_. This is the spine that the character mesh eventually will be bound onto (see Figure 17.28).

    Figure 17.28
    This is the spine that the character mesh eventually will be bound onto.

Note - This situation will result in the creation of three hierarchies in the end. One of them (the one you just duplicated) will have the character's skin bound to it and will be partially controlled by the original stretchy spine splineIk hierarchy. These two hierarchies will need to stay unparented from any group that will transform with the character because these two hierarchies will be entirely controlled by the lowRes spine that is currently smooth-skinned to the spine's spline curve. If you transform the bound IK spline hierarchy as well as the low-res control spine, you get double transforms. I discuss this later, but hopefully this helps enlighten things a little bit more for now.

Created: March 11, 2003
Revised: November 7, 2003

URL: http://webreference.com/3d/insidemaya/1