Advanced Rigging

Stretchy Torso

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 torso and further understand the concepts behind this tutorial, please view the origonal text: Animator Friendly Rigging Part 2, pages 96 through 173.

Tutorial

  1. Duplicate the geometry, name one of the group copies "mime_hi" and the other "mime_lo".
  2. Segment the Geometry. Divide the "mime_lo" model into segments for each part of the body. Select the faces that you would like to extract, then in the polygons menu go to Mesh>Extract. Below is a listing of all of the body segments that you should have and what they should be named. In the case of the torso, when you extract, the result will be two seperate pieces of geometry rather than just one like all of the others. Name the portion with the pants "hips_geo" and the top portion "torso_geo". Note: Don't separate the geometry, this is just for your viewing pleasure.
    • l_eye_geo
    • r_eye_geo
    • l_gloves_geo
    • r_gloves_geo
    • l_shoes_geo
    • r_shoes_geo
    • head_geo
    • hat_geo
    • l_arm_geo
    • r_arm_geo
    • torso_geo
    • l_leg_geo
    • r_leg_geo
    • hips_geo
  3. Select all of the geometry and go to Edit>Delete by Type>History. Once you start rigging you will have to be careful with this, if you delete history on a rig when you don't mean to, it will destroy all of your hard work. So if you are going to delete by type, delete onlt the Non-Deformer History unless explicitly stated otherwise.
  4. Segment the Shoulder and Hip Areas. Select torso_geo, then click on the Add Plane for Cutting Polygonal Geometry button in the Rigging shelf. The cut plane will be created and automatically selected. Move it so that it’s at the place where you want the hips to be segmented. Click on the Add Plane for Cutting Polygonal Geometry button again to
    create another plane, you can have either the plane or the torso selected. If the plane is selected, it will automatically figure out that you want to create a plane for the torso geometry. Move the second plane to the bottom of where the shoulders should be. Select one of the planes, or the torso. Click on the Cut Selected Objects With Planes button on the Rigging shelf. The torso will automatically be cut and separated wherever the planes were located on the body. The planes will also be deleted when you’re finished.
  5. Rename the new segments to "shldr_geo", "body_geo", and "hips_geo".
  6. Hide all of the geometry except for "body_geo".
  7. Create a Joint from the bottom of "body_geo" to the top of "body_geo". Choose Skeleton > Joint Tool. Click at the base of body_geo in the middle of the back horizontally. Hold down SHIFT and click again at the top of body_geo. SHIFT constrains the next joint horizontally or vertically, depending on which direction you move. It’s incredibly handy for making nice straight joints! Hit Enter to confirm your joint creation.
  8. Select the joint that you just created. Click on the Split Selected Joint tool in the Rigging shelf. Set Segments to 6. Click okay.
  9. Create a cutting plane for each joint. Select body_geo. Click on the Add Plane for Cutting Polygonal Geometry button Rigging shelf. Do not create a plane on the top or bottom joint because there is no geometry to separated. Hold "v" to point snap to the joint, you should have the cutting plane centered on the joint. Create one plane for each joint that separates geometry (5 planes total). Click on the Cut Selected Objects With Planes button on the Rigging shelf.
  10. Unite the top pieces of the torso. Select the two pieces of geometry at the top of the torso. Choose Mesh > Combine. Choose Edit > Delete By Type > History.
  11. Rename the back pieces to torso_#_geo, starting from the base of the spine and moving up towards the neck.
  12. Name the joints torso_#_joint, starting with torso_1_joint at the root of the joint chain.
  13. Parent each piece of geometry to it's respective joint. Select the child, then the parent and press "p".
  14. Create a hip_joint. Select torso_1_joint. Duplicate it by choosing Edit > Duplicate. Delete all of it’s children. Rename it hip_joint.
  15. Create a hip_joint. Select hip_joint. Duplicate it by choosing Edit > Duplicate. Choose the Move tool. Hold down the “v” hotkey to enable Point Snap mode. With the Middle Mouse Button, Click and drag near torso_7_joint in the perspective view. This will snap the new joint to the position of torso_7_joint. Rename the new joint shldr_joint.
  16. Unhide the hip_geo and shldr_geo meshes. Parent hip_geo to hip_joint. Parent shldr_geo to shldr_joint.
  17. Import Controls. Choose File > Import. Navigate to production2>rigging_files>control_library. Import circleArrow.ma and circleArrowTwo.ma. Name the circleArrow control that was imported to hip_anim. Name the circleArrowTwo control to shldr_anim.
  18. Select hip_anim. Choose the move tool. While holding down v, click and drag with the Middle Mouse Button and move it to the location of the hip_joint.
  19. Select shldr_anim. Choose the move tool. While holding down the v hotkey, click and drag with the Middle Mouse Button and move it to the location of shldr_joint. Rotate the control 90 degrees in Z, and scale it down a bit to fit around the body.
  20. Select hip_anim and shldr_anim. Choose Modify > Freeze Transformations > Option Box. Make sure the transformation freezing is set for Translation, Rotation, and Scale.
  21. Constrain hip_joint and shldr_joint to the appropriate anim controls. Select hip_anim and hip_joint. Choose Constrain > Parent. Select shldr_anim and shldr_joint. Choose Constrain > Parent.
  22. Set the rotation orders. Select hip_anim, shldr_anim, hip_joint, and shldr_joint. Choose the Change Rotate Order On Selected Objects button on the Animator Friendly Rigging shelf. This brings up the js_rotationOrderWin.melxii script. Set the Rotation Order to zxy. Click Set Rotation Orders.
  23. Select shldr_anim and hip_anim. In the Channel Box highlight scaleX, scaleY, scaleZ and visibility. Choose RMB > Lock and Hide Selected.
  24. Create Spline IK. Choose Skeleton > IK Spline Handle Tool. In the Outliner, click on torso_1_joint and then hold down and click on torso_7_joint. This will create the splineIK Control. Rename ikHandle1 to back_ikHandle. Rename curve1 to back_curve. Rename effector1 to back_effector.
  25. Attach the curve to the hip and shoulders. Select hip_joint, shldr_joint, and back_curve. Choose Skin > Bind Skin > Smooth Bind.
  26. Add Squash and Stretch. Select back_curve. Click on the Create Stretchy Spline button in the Rigging Shelf. This will execute the js_createStretchSpline.melxiii script that will automatically create a stretchy spline with the control curve for managing the volume preservation.
  27. Move the hips and shoulders around to see what type of deformation you get.
  28. Stretch the back out so it’s very long (set the shldr_anim.t to 0 2 0). Select back_curve – This is where the curve is that represents the back squash and stretch control. Open the Graph Editor. Tweak the curve until you get the type of deformation that you like. Once the torso deforms the way that you want it to, put shldr_anim back to its origonal position.
  29. Add Twist. The next step in our process of creating the back rig is to add the twisting into the back, based off of the hips and shoulder rotation. Select back_ikHandle. Open the Attribute Editor. Open Ik Solver Attributes. Scroll down and open Advanced Twist Controls. Turn on Enable Twist Controls. Set World Up Type to Object Rotation Up. Set Up-Axis to Negative Z. Set Up Vector to 0 0 –1. Set Up Vector 2 to 0 0 –1. Set World Up Object to hip_anim. Set World Up Object 2 to shldr_anim.
  30. TEST YOUR TWIST NOW! If it doesn't work, you can try changing the up axis and the vectors.
  31. Create the FK Skeleton. Choose Skeleton > Joint Tool. While holding down the v key for point snap, Click and drag near the hip_joint to snap the joint at the hip. While holding down the v key for point snap, click and drag near the shldr_joint to snap to the joint at the shoulder. Hit enter to complete your segment. This should create a joint segment going from the hip to the shoulder.
  32. Orient the joint correctly. Select joint1. Choose Skeleton > Orient Joint > Option Box. Pick either Orientation YZX and Second Axis World Orientation of +Z, OR Orientation YXZ and Second Axis World Orientation of +X. Click Orient.
  33. Change the rotation order in the attribute editor. Select joint1. Change the rotation order to YZX.
  34. Segment the Joint. Select joint1. Click on the Split Selected Joint button on the Rigging shelf. Set Segments to 3.
  35. Rename joint1 to torso_base_joint. Rename joint1_seg_1 to torso_1_anim. Rename joint1_seg_2 to torso_2_anim. Rename joint2 to torso_end_joint.
  36. Make a body control. Choose File > Import. Navigate to production2>rigging_files>control_library. Import square.ma. Rename square_anim to body_anim.
  37. Select body_anim. Choose the Move tool. Holding down the v hotkey for point snap, click and drag with the Middle Mouse Button near hip_joint to snap body_anim to the position around the hip. Freeze Transformations on the control when it is in its final position.
  38. Parent torso_base_joint to body_anim. Select torso_base_joint. Shift + Select body_anim. Hit the p hotkey to parent torso_base_joint to body_anim
  39. Parent hip_anim to torso_base_joint. Select hip_anim. Hit CTRL+G to group it to itself. Note: This is necessary to ensure that hip_anim’s translations and rotations stay at 0 0 0 when it’s parented. Rename group1 to hip_ grp. Select hip_grp and then torso_base_joint. Hit the p hotkey to parent hip_grp to torso_base_joint.
  40. Parent shldr_anim to torso_end_joint. Select shldr_anim. Hit CTRL+G to group it to itself. Rename group1 to shldr_grp. Select shldr_grp and then torso_end_joint. Hit the p hotkey to parent shldr_grp to torso_end_joint.
  41. Change the rotation order of body_anim. Select body_anim. Click Change Rotation Order on Selected Objects Shelf Button. Change the rotation order to zxy (so it matches the hip_anim and shldr_anim controls).
  42. Clean up the anim controls. The following attributes should be locked and non-keyable.
  43. Hide anything that you don’t want selected. Select back_ikHandle and back_curve. Hide them by hitting ctrl+h
  44. Create Display layers for the controls and the things you don’t want the animator to select. Create a Display Layer called mid_anim_layer. Create a Display Layer called doNotTouch_layer
  45. Add some items to DoNotTouch. Select torso_1_joint, hip_joint, shldr_joint, back_ikHandle, back_curve. Click with the Right Mouse Button over doNotTouch_layer and choose Add Selected Objects.
  46. Load the Display Layer Relationship Panel. Choose Layers > Membership. Assign Some objects to DoNotTouch by selecting doNotTouch_layer and clicking on torso_base_joint and torso_end_joint.
  47. Assign the animation controls to mid_anim_layer in the Layer Relationship Panel by clicking on mid_anim_layer. Select body_anim, torso_1_anim, torso_2_anim, shldr_anim,
    and hip_anim.
  48. Set doNotTouch_layer to Reference by clicking on the empty box next to the "V" in the Layer Editor until it looks like an "R"
  49. Group body_anim to itself to form a group called anim_grp. Select body_anim. Use the CTRL+g hotkey to group body_anim to itself. Rename group1 to anim_grp.
  50. Group all the other nodes together. Select torso_1_joint, hip-joint, shldr_joint, back_ikHandle, back_curve. Use the CTRL+g hotkey to group them all together. Rename group1 to doNotTouch_grp
  51. Lock the attributes on doNotTouch_grp. In the Channel Box, select all the attributes. RMB > Lock Selected
  52. Group everything under an all_anim. In the outliner, select body_anim and doNotTouch_grp. Use the CTRL+g hotkey to group them together. Rename group1 to all_anim.
  53. TEST YOUR RIG! Try moving all_anim ;) It should be "broken". The torso will translate twice as far as you think it should. The scale will also have problems associated with it. So now you get to fix your rig.
  54. Turn off inherits transform on back_curve. Select back_curve. Open the Attribute Editor. At the bottom of the Transform Attributes section, turn off Inherits Transform.
  55. Fix the back scale expression. Open up the expression editor choosing Window > Animation Editors > Expression Editor. Choose Select Filter > by Expression Name. Choose back_curve_expr. At the top of the expression, you will see a line that looks like this:
    $scale = curveInfo1.normalizedScale;
    Replace it with a line that looks like:
    $scale = curveInfo1.normalizedScale/all_anim.scaleY;
    Click the edit button at the bottom of the expression editor when you are done. If there is an error ( the line next to the script editor will turn pink and say what happened) you need to troubleshoot this before moving on.
  56. Connect scaleX and scaleZ to scaleY. Select all_anim. Open the Connection Editor by choosing Window > General Editors > Connection Editor. Click Reload Left and Reload Right to load all_anim into both sides. Make sure show non-keyable is off on both sides. On the Left side, click scaleY. On the Right side click scaleX and scaleZ.
  57. Hide scaleX and scaleZ in the channel box. Select all_anim. In the Channel Box, select ScaleX and ScaleZ. Use RMB > Lock and Hide Selected
  58. Rename scaleY to something that makes sense to the animator. Open the script editor. We’re going to use the aliasAttr command to make an alias for scaleY. Enter the following command in the script editor:
    aliasAttr globalScale all_anim.scaleY;
  59. Create a nurbsCircle. Choose Create > Nurbs Primitives > Circle
  60. Parent nurbsCircleShape1 to torso_1_anim. Enter the following command in the script editor: parent –add –shape nurbsCircleShape1 torso_1_anim;
  61. Scale the circle. Select torso_1_anim. Hit F8 to switch to component mode. Select the cvs on the circle. Scale them until the circle fits snugly around the torso.
  62. Delete nurbsCircle1
  63. In the channel box, rename nurbsCircleShape1 to torso_1_animShape
  64. Create another nurbsCircle. Choose Create > Nurbs Primitives > Circle
  65. Parent the shape to torso_2_anim. Enter the following command in the script editor parent –add –shape nurbsCircleShape1 torso_2_anim;
  66. Scale the Cvs so it’s smaller. Select torso_2_anim. Hit F8. Scale the CVS.
  67. Delete nurbsCircle1
  68. In the channel box, rename nurbsCircleShape1 to torso_2_animShape
  69. Create a display layer called fk_torso_layer. Click on the Create Layer button. Rename the new layer fk_torso_layer
  70. Add the fk controls to the fk_torso_layer. Select fk_torso_layer. Choose Layers > Memberships. Select fk_torso_layer in the Relationship Editor. Now select torso_1_anim and torso_2_anim in the Relationship Editor
  71. Change the colors of the layers. Double-click on fk_torso_layer. Change the color to something distinctive (... Yellow).
  72. Do the same thing with mid_anim_layer and pick a color that will stand out against the background (... Burgundy).
  73. Unlock shldr_grp. Select shldr_grp. In the channel box, click with the Right Mouse button and bring up Channel Control. Switch to the Locked tab and select all the attributes on the left. Move them over to the right by clicking Move >>
  74. Duplicate shldr_grp
  75. Delete the child of shldr_grp1
  76. Rename shldr_grp1 to shldr_grp_pos
  77. Constrain shldr_grp to shldr_grp_pos. Select shldr_grp_pos and then shldr_grp. Choose Constrain > Parent
  78. Parent shldr_grp under torso_base_joint. Select shldr_grp and then torso_base_joint. Hit the p hotkey to parent it.
  79. Now you are done with the torso! Test the torso to make sure it works like how we demonstrated it in class.