Advanced Rigging

Stretchy Neck

Introduction

This tutorial is an abridged/slightly modified version of a master class tutorial led by Jason Schleifer for SIGGRAPH 2006. If you would like to learn more about creating a stretchy neck and further understand the concepts behind this tutorial, please view the origonal text: Animator Friendly Rigging Part 2, pages 209 through 279.

Tutorial

Preparing the Geometry and Controls

  1. Unhide the head geometry and segment mesh into two pieces at the jawline. Select the faces to split and use the Mesh > Extract tool.
  2. Select the two segments and delete history. Unparent them from any group they are in (if it leaves a null/empty group, you can delete that).
  3. Rename polySurface1 head_geo, Rename polySurface2 neck_geo.
  4. Create a joint that starts at the base of the neck and goes the bottom of the head. Make sure you place the topmost joint correctly, try testing where your head rotates from to see where the joint should be placed.
  5. Create a nurbs circle and vertex snap it to the top joint in the neck. Press F8 and move the control vertices of the circle to fit around the head better so that it is obviously a head control to an animator (you will also be creating controls for the ears and the mouth, so make sure that you leave space for those).
  6. Rename the circle head_anim.
  7. Unparent hat_geo, l_eye_geo, and r_eye_geo if they are parented to anything (they should be children of the world, so on the top level of the outliner at this point). Select hat_geo, l_eye_geo, r_eye_geo, and head_geo and group them together by hitting ctrl+g. Rename the group head_geo_grp.
  8. Select head_geo_grp and head_anim. Load the Change Rotation Order On Selected Objects button on the Rigging shelf. Set the rotation orders to ZXY, the same as shldr_anim.
  9. Select head_anim and then head_geo_grp. Click on the Match Pivots icons in the Rigging shelf to copy the pivot location from head_anim to head_geo_grp.
  10. Select head_anim and then head_geo_grp. Choose Constrain > Parent.

Making the Stretchy IK

  1. Break the neck into 3 parts by selecting joint1 then clicking on the Split Selected Joint button in the Rigging shelf. Set Segments to 3. Click Okay.
  2. Rename the neck joints. Rename joint1 to neck_base_joint. Rename joint1_seg_1 to neck_1_joint. Rename joint1_seg_2 to neck_2_joint. Rename joint2 to neck_end_joint.
  3. Choose Skeleton > Spline Ik Handle Tool. Click on neck_base_joint and neck_end_joint
  4. Rename ikHandle1 to neck_ikHandle. Rename curve1 to neck_curve.

Adding Advancecd Twist Controls

  1. Select neck_ikHandle. Open the Attribute Editor. Open the ikSolver Attributes. Open Advanced Twist Controls. Set the following options:
    Enable Twist Controls on
    World Up Type Object Rotation Up [start | end]
    Up Axis Positive Y
    Up Vector 0 0 –1
    Up Vector 2 0 0 –1
    World Up Object shldr_anim
    World Up Object 2 head_anim

Creating Bind Joints

  1. Choose Skeleton > Joint Tool. Create a joint in the same place as neck_base_joint, neck_1_joint, and neck_end_joint. joint2 should be parented to joint1, however joint3 should be on the top level of the outliner with joint1.
  2. Rename joint1 to neck_curve_base_bind. Rename joint2 to neck_curve_1_bind. Rename joint3 to neck_curve_top_bind.
  3. Select neck_curve_base_bind, neck_curve_1_bind, neck_curve_top_bind, and neck_curve, Choose Skin > Bind Skin > Smooth Bind.

Applying Stretch to the Neck

  1. Select neck_curve. Click on the Create Stretchy Spline curve in the Rigging Shelf. Set the following options:
    Nurbs Curve: neck_curve
    Maintain Volume: off
    World Scale: on
    Node: all_anim
    Attribute: globalScale
  2. Click Apply
  3. Parent neck_curve_top_bind to head_anim
  4. Parent neck_curve_base_bind to shldr_anim
  5. Select neck_base_joint and neck_geo. Choose Skin > Bind Skin > Smooth Bind > Option Box. Set the following options:
    Bind to: Joint hierarchy
    Bind Method: Closest distance
    Max Influences: 5
    After Bind: Maintain max influences on
    Dropoff rate: 4
    Remove unused influences on
    Colorize skeleton on
  6. Click Bind Skin

Add Influence Objects

  1. Create a polygon cube by choosing Create > Polygon Primitives > Cube. Position the cube at the top of the neck (use point snapping).
  2. In the channel box, click polyCube1 (under the INPUTS label). Change subdivisions depth to 3, change width, height, and depth to 1.
  3. Position the vertices in the side view such that the cube follows the jaw.
  4. Create another cube that is at the bottom of the neck joints.
  5. Rename pCube1 to neck_top_inf. Rename pCube2 to neck_bot_inf.
  6. Select neck_geo and neck_top_inf
  7. Choose Skin > Edit Smooth skin > Add Influence
  8. Select neck_geo and neck_bot_inf
  9. Choose Skin > Edit Smooth Skin > Add Influence
  10. Parent neck_top_inf to head_anim
  11. Parent neck_bot_inf to shldr_anim
  12. Hide neck_bot_inf and neck_top_inf
  13. Select the bottom few rows (say 3 or 4) of vertices on neck_geo and go to Window > General Editors > Component Editor.
  14. Go to the smooth skins tab.
  15. Change all of the number values in the neck_bot_inf column to 1.
  16. Select the top row of vertices on neck_geo.
  17. Change all of the number values in neck_top_inf column to 1. Close the component editor.
  18. Select neck_geo and go to Skin > Edit Smooth Skin > Pain Skin Weights > Option Box.
  19. Select neck_bot_inf and select smooth. Hit flood a few times.
  20. Select neck_top_inf and select smooth. Hit flood a few times.
  21. Go back to the component editor and change all of the numbers in the neck_top_inf column to 1 when you have the top row of vertices selected.

Fix Joint Flipping in the Neck

  1. Choose Create > measure tools > Distance Tool. Press v to point snap the two locators to neck_end_joint and neck_base_joint.
  2. Rename distanceDimension1 to neck_distance, Rename locator1 to neck_length_top, Rename locator2 to neck_length_bot
  3. Select neck_distance
  4. Open up the Hypergraph by going Window > Hypergraph: Connections
  5. Choose Rendering > Create Render Node
  6. Switch to the Utilities tab.
  7. Click Multiply Divide. Rename multiplyDivide1 to neck_normalized_scale.
  8. Click on all_anim in the Outliner with the middle mouse button and drag and release on the Hypergraph.
  9. Use the Middle Mouse Button to drag neck_distanceShape onto neck_normalized_scale.
  10. When the menu pops up, click Other. This will open the Connection Editor. Connect the neck_distanceShape.distance to neck_normalized_scale.input1X
  11. Use the Middle Mouse Button to drag all_anim onto neck_normalized_scale.
  12. When the menu pops up, click Other. This will open the Connection Editor. Connect globalScale (remember, it used to be scaleY) to input2X.
  13. Select neck_normalized_scale in the Hypergraph.
  14. Hit Ctrl+a to open the Attribute Editor
  15. Change Operation to Divide
  16. Parent neck_length_top to head_anim
  17. Parent neck_length_bottom to shldr_anim
  18. Select neck_curve_top_bind and neck_curve_base_bind
  19. Select the scale attributes in the channel box.
  20. Choose RMB > Editors > Set Driven Key
  21. Select neck_normalized_scale in the Hypergraph.
  22. Click Load Driver in the Set Driven Key menu.
  23. In the top pane select outputX as the driver
  24. In the bottom pane, select both joints and the scale attributes as the driven.
  25. Click Key to set the default setting.
  26. Move the head closer to the neck until you see the joints start to flip (it will look like the top joint is bending down to touch the bottom joint).
  27. Now select neck_curve_base_bind and neck_curve_top_bind
  28. Set their scale values down to .001
  29. Click Key.
  30. Now when you manipulate the head, the joints shouldn’t flip.

Create a Neck Control

  1. Create a joint chain with 2 joints in it. One should be at the bottom most neck joint, the other should be placed at the top most neck joint.
  2. Rename joint1 to neck_anim. Rename joint2 to neck_anim_end_joint.
  3. Parent neck_anim to shldr_anim
  4. Select neck_anim. Choose Skeleton > Orient Joint > Option Box. Set Orientation to YXZ. Set Second Axis World to +x. Click Orient.
  5. Set the rotation order to yzx in the attribute editor.
  6. Create a nurbs Circle using Create > NURBS > Circle
  7. Select nurbsCircle1 and neck_anim and click the shape button on the Rigging Shelf.
  8. Select the Cvs of the circle by hitting the F8 hotkey.
  9. Select the CVS. Scale them down closer to the neck.
  10. Delete nurbsCircle1

Create a Multi-Constraint for Translation and Orientation

  1. Click on the Setup Multi Constraint UI button in the Rigging shelf.
  2. Select head_anim and click Load Selected for Object To Constraint.
  3. While head_anim is still selected click Load Selected for Control Object.
  4. Select neck_anim_end_joint, shldr_anim, body_anim, and all_anim and click the + button to add them as Target Objects
  5. Turn OFF Orient, and turn ON Point
  6. Set Control Attribute to t_space
  7. Click Apply
  8. Rename head_anim_grp to head_anim_t_grp
  9. Turn OFF Point and turn ON Orient.
  10. Change Control Attribute to o_space.
  11. Click Apply
  12. Rename head_anim_grp to head_anim_o_grp
  13. Select head_anim
  14. Select T_space in the Channel Box
  15. Choose RMB > Attributes > Edit Attribute
  16. Select t_space
  17. Down in Enum Names you can see the list of items that we have to work with.
  18. Select neck_anim_endJoint
  19. In the new name field, enter neck and hit return.
  20. Change the other names to shldr, body, and all.
  21. Click on o_space
  22. Change the names to neck, shldr, body, and all
  23. Set head_anim.o_space to all
  24. Set head_anim.t_space to neck
  25. Now depending on the settings, the head will follow either the shoulders, neck, body, or all anim controls. Test it out, you should try the different settings and move the anim controls associated with the neck , shoulders, body, and all.

Clean Up

  1. Select head_anim
  2. In the Channel Box, select the scale attributes and the visibility.
  3. Choose RMB > Lock and Hide Selected
  4. Select neck_anim
  5. In the Channel Box, select the translate, scale, and visibility attributes.
  6. Choose RMB > Lock and Hide Selected
  7. Parent head_anim_t_grp under anim_grp
  8. Select neck_base_joint, neck_ikHandle, neck_curve, neck_top_infBase, neck_bot_infBase, and neck_distance
  9. Hit ctrl+g to group them together. Rename the group neck_grp.
  10. Parent neck_grp under doNotTouch_grp
  11. Parent head_geo_grp under doNotTouch_grp
  12. Parent neck_geo under doNotTouch_grp
  13. Select neck_curve. Open the Attribute Editor. Turn off Inherits Transform.
  14. Select neck_geo. Open the Attribute Editor. Turn off Inherits Transform.
  15. Hide neck_base_joint
  16. Hide neck_ikHandle
  17. Hide neck_curve
  18. Hide neck_distance
  19. Hide neck_length_top
  20. Hide neck_length_bottom
  21. Hide neck_curve_base_bind
  22. Hide neck_curve_top_bind
  23. Hide neck_anim_end_joint
  24. Add head_geo_grp to doNotTouch_layer
  25. Create a new layer called fk_neck_layer
  26. Add neck_anim to fk_neck_layer
  27. Color fk_neck_layer yellow
  28. Add head_anim to mid_anim_layer
  29. If there is anything left over in your all_anim group other than: anim_grp, doNotTouch_grp, or settings_anim, move it into doNotTouch_grp
  30. DONE!