Chapter 7. Rigging and Muscle Systems

A rig is an organized system of deformers, expressions, and controls applied to a surface so an animator can easily and efficiently animate the surface. A good rig should be easy to use so the animator can concentrate on the art of animation without the technical aspects of rigging getting in the way. In addition, a good rig should be well organized so it can easily be changed, repurposed, or fixed if there is a problem.

Rigging as a practice is continually evolving in the industry. New technologies, concepts, and approaches emerge every day and are widely debated and discussed among professional technical directors throughout the world. While this chapter will offer advice on how to best approach creating part of a character rig in Maya, its main purpose is to help you understand how the tools work so that you can approach creating your own rigs and adapting rigging practices from others.

In this chapter you will learn to:

  • Understand rigging

  • Create and organize joint hierarchies

  • Use Inverse Kinematics rigs

  • Apply skin geometry

  • Use Maya Muscle

Understanding Rigging

The most common types of rigs are created using joint deformers. In character animation a skeleton system is created from joints to match the basic shape of the character. A joint is represented by a simple wireframe sphere. Joints are connected by bones, which are represented by a wireframe pyramid. When one joint is parented to another joint, the bone is aligned so the pointed end of the pyramid points to the child joint.

The geometry of the character is bound or skinned to the joints so the joints deform the geometry, making knees bend, wrists twist, fingers clench, and so on. Each joint in a hierarchy exerts influence over each vertex of the geometry, pushing or pulling it in one direction or another. The amount of influence exerted on a vertex by a joint is controlled through weighting (see Figure 7.1).

Once geometry has been skinned to a skeleton of joints, a system of controls is created to make animating the joints as simple as possible. Controls may be created from locators or curves or any other node which can be selected in the viewport. These nodes then control the movement of joints via expressions, constraints, or driven keys. You used a simple control system in Chapter 5 to rig a mechanical bug model.

Joints are positioned based on the shape of the object they are meant to deform.

Figure 7.1. Joints are positioned based on the shape of the object they are meant to deform.

In addition, other types of deformers (such as the ones described in Chapter 6) are often applied to the geometry to compensate for the shortcomings of simple joint deformations. Joints by themselves will not maintain the volume of a surface properly when animated or create the impression of muscle, flesh, and bone beneath skin. Influence objects, lattice deformers, Maya Muscle, and other tools and techniques are often used to create believable motion and simulate the properties of flesh and tissue for characters. In addition, joints can be used to deform some types of other deformers such as lattices. A joint used as a deformer indirectly deforms geometry, or groups of objects, by deforming the lattice, which then deforms the geometry.

The first half of this chapter explores techniques for creating efficient character rigs. There are many approaches to rigging characters; the main focus of these lessons is to build an understanding of how the Maya toolset works so you can adapt it to your preferred rigging workflow. The lessons provide additional tips and tricks that can help you avoid common rigging pitfalls.

Although this chapter provides some background information for the techniques described, you should familiarize yourself with the fundamentals of how to create joints and to bind geometry to joints before attempting the exercises. Information on joint deformers is available in the Maya help files.

The second half of the chapter is devoted to Maya Muscle, which is a plug-in that has been fully integrated into Maya 2009. Maya Muscle is designed to create realistic deformations for character rigs. The muscle system works with skeletons to simulate the qualities of flesh and skin.

Creating and Organizing Joint Hierarchies

The Joint tool creates a joint each time you click on the scene. As long as the Joint tool is active, each time you click on the scene a new joint is added and parented to the previous joint, forming a simple hierarchy known as a joint chain. To exit the Joint tool, press the Enter key on the keyboard. This is useful if you need to finish one joint chain and then start another.

You can create branches of joints by parenting joint chains to intermediate joints in the initial chain. By parenting the branches and groups of joint chains, very sophisticated joint hierarchies, known as skeletons, can be created quickly.

Because many skeletons can become quite complex, they should be properly organized and labeled so animators and other riggers (referred to as technical directors in some instances) can easily access and understand the skeleton and all of its various parts.

The orientation of joints relative to their parent joints must be consistent throughout the skeleton to achieve proper functionality. The default orientation of a joint, established when the joint is added to a chain, is often incorrect and can lead to problems such as Gimbal Lock.

In this section you'll review how to create and organize a joint hierarchy for a character's arm and hand.

Create Joints

The Joint tool adds joints to a scene. When creating joints you want to visualize a simplified skeleton based on the shape of the geometry in the scene.

  1. Open the leftArm_v01.ma scene from the chapter7scenes folder on the DVD.

    This scene has the arm of a human character created with polygons. To keep things simple, the rest of the body has been removed.

  2. In the perspective view, switch to the top view.

  3. Switch to the Animation menu set. Choose Skeleton

    Create Joints
  4. Turn on Grid Snapping.

    You'll create the arm's joint chain in front of the geometry and then reposition the joints after they have been created.

    Rotate your wrist as if you were opening a door handle, you'll notice that this type of rotation originates not in the wrist, but in the middle of the forearm (the rotation is created by the two bones of the forearm: the radius and the ulna). To simulate this rotation, the forearm is split into two joints. These joints must be in a straight line or the arm will appear broken as it rotates. The best approach is to use Grid Snapping to create the joints along a straight line and then position and rotate them into place to match the arm geometry.

  5. With the Joint tool active, click five times on the grid in a straight line in front of the arm, as shown in Figure 7.2. When you have created five joints, press the Enter key to complete the operation.

    Initially place the arm joints in a straight line in front of the geometry.

    Figure 7.2. Initially place the arm joints in a straight line in front of the geometry.

  6. In the Outliner, Shift+click on joint1 to expand the joint chain hierarchy. The joints are labeled joint1, joint2, joint3, joint4, and joint5. You can see how they are parented in a simple chain (see Figure 7.3).

  7. Turn off Grid Snapping and select joint1. In the options for the Move tool, set Move Axis to Local. In the top view, use the Move tool to position the joint near the center of the shoulder, as shown in the top image in Figure 7.4.

    Expand the joint chain in the Outliner.

    Figure 7.3. Expand the joint chain in the Outliner.

  8. To position the other joints in the arm, you can either rotate the joint above the joint you want to position or use the Move tool while holding the d key. Do not move or rotate joint4 out of its alignment with joint3. Even a slight change in its position will cause problems later on.

  9. At this point the best way to position joint5 is to rotate joint3 until joint5 is located near the position of the wrist. Use the middle image in Figure 7.4 as a guide as you position the joints. If you need to move joint5 closer to the center of the wrist, use the Move tool but move it only along the local X axis (the red handle of the Move tool) so it does not disturb the rotation of joint4.

    It's important to have a slight rotation for the elbow if you decide to use Inverse Kinematics later on. When you create Inverse Kinematics, Maya needs a hint as to how you want the joint to bend when the IK Handle is created and moved. Inverse Kinematics are discussed in more detail later in the chapter. For now, make sure there is an angle in the joint chain at the location of the elbow (joint3).

  10. Switch to the front view. The joint chain is far below the arm geometry, close to the origin. Use the Move tool to move joint1 so the joints are in the center of the arm.

  11. Use the Move tool to lower joint2 slightly to create a bend in the chain at the start of the upper arm. Rotate joint2 so the end of the chain is at the center of the wrist (see Figure 7.4, bottom image).

    Carefully position the joints to match the shape of the arm.

    Figure 7.4. Carefully position the joints to match the shape of the arm.

    The joints for the fingers are created in a similar fashion. The easiest way to create the fingers is to make small joint chains, position them, and then parent them to the wrist.

  12. Switch to the top view again, and turn on Grid Snapping. In front of the hand, make a small joint chain consisting of four joints.

  13. Turn off Grid Snapping. Use the Move tool to position the root of the finger joint chain in the pointer finger. Rotate the root joint to match the finger. Use the Move tool to position the finger joints, but be careful to pull the joints only along the local X axis so the joint chain remains straight.

  14. When you have the chain positioned, select the root (joint6) and duplicate the chain (Ctrl+d).

  15. Move the duplicate into position in the middle finger. Repeat this process for the other fingers of the hand, but not the thumb.

  16. To make the thumb, create a small joint chain of just three joints. Position it using Figure 7.5 as a guide.

    Create joint chains for each finger.

    Figure 7.5. Create joint chains for each finger.

  17. Create a single joint by clicking once on the grid in the top view and pressing the Enter key. Position this joint in the palm toward the pinky side of the hand, as shown in the top of Figure 7.6.

  18. Duplicate this joint and move it down toward the center of the palm. Duplicate the joint one more time, and place this third joint at the bulge in the hand where the thumb starts (see the center image in Figure 7.6).

  19. Select the root of the thumb chain and the free joint at the base of the thumb; then press the p hot key to parent the thumb chain to this joint. Parent both the pointer finger and the middle finger to the joint at the center of the palm. Parent the ring finger and the pinky to the free joint above the center of the palm (bottom image in Figure 7.6).

    Create individual joints and position them in the hand.

    Figure 7.6. Create individual joints and position them in the hand.

  20. Create another free joint at the base of the wrist, and parent the three joint chains to this free joint (Figure 7.7, top image).

  21. Switch to a front view, and move up the root of the finger joints (the joint created in step 20) so it fits in the hand. Parent this joint to the joint at the end of the arm (Figure 7.7, center image).

  22. Switch to a perspective view. Carefully move and rotate the joints to match the bend in each finger. The safest way to position the finger joints is to use the Move tool and move the joints only along the X and Y axes (Figure 7.7, bottom image).

    Move up the hand joints to the hand geometry and parent them to the arm.

    Figure 7.7. Move up the hand joints to the hand geometry and parent them to the arm.

    Note that the ring and pinky fingers use a separate joint chain from the index and middle fingers. This arrangement is used to allow the palm of the hand to roll inward so the character can grab objects.

  23. Save the scene as leftArm_v02.ma. To see a version of the scene to this point, open the leftArm_v02.ma scene from the chapter7scenes directory on the DVD.

Orient Joints

To ensure joints behave as expected when animated, establish proper joint orientation after the joints are placed in the geometry (but before the geometry is bound to the model).

Typically, each joint is oriented so the X axis of its rotation is aimed along the length of the joint. The axis points down toward the child joint. To see the rotation axis of a joint, select the joint and switch to component mode (hot key = F9), and press the question mark icon on the status line (see Figure 7.8).

The rotation axes of joints are displayed when the joint is in component mode.

Figure 7.8. The rotation axes of joints are displayed when the joint is in component mode.

Once you've placed the joints in their correct position, freeze transformations so the Rotate X, Y, and Z channels are all at 0.

  1. Continue with the scene from the previous section or open the leftArm_v02.ma scene from the chapter7scenes directory on the DVD.

  2. In the Outliner, select joint1. In the Channel Box, the Rotate X, Y, and Z channels are already 0. This is most likely true for most of the joints in the chain, but always double-check to make sure.

  3. Press the down-arrow key, and observe the Rotate channels in the Channel Box. As you press the down-arrow key, you can pick walk through the joint chain and quickly see which joints have non-zero values in their Rotate channels.

    Pick walking through the joint chain may not select the joints that branch from the main chain, so remember to check these joints as well. You can do this either by selecting them or by selecting the joints at the end of the branch and pressing the up-arrow key to pick walk in the reverse direction. Taking the time to perform this check saves work and aggravation later on.

  4. As you can see, many of the joints do have non-zero values in the Rotation channels. To fix this, select joint1 and choose Modify

    The rotation axes of joints are displayed when the joint is in component mode.

    Another way to edit the orientation of the joint is to open the joint's Attribute Editor and enter values in the Joint Orient fields. These fields control the joint's local rotation; changing these values will not affect the Rotate channel values in the Channel Box (see Figure 7.9). You can also automatically orient the joints using the Skeleton

    The rotation axes of joints are displayed when the joint is in component mode.
    The Joint Orient fields allow you to adjust the local rotation of a joint without affecting the Rotate channels in the Channel Box.

    Figure 7.9. The Joint Orient fields allow you to adjust the local rotation of a joint without affecting the Rotate channels in the Channel Box.

  5. Select joint1 and choose Skeleton

    The Joint Orient fields allow you to adjust the local rotation of a joint without affecting the Rotate channels in the Channel Box.

    When you set the Second Axis World Orientation to -Y, the rotational axis of each joint is oriented so the red X axis points down the length of the bone, the blue Z axis points toward the back of the skeleton, and the green Y axis points downward. This type of orientation ensures that when rotating the elbow inward toward the chest, the Rotate Y values are positive and the finger joints use positive values on the Z axis when rotating in toward the palm. This behavior is ideal, especially if you decide to set rotation limits on the joint (a discussion of rotation limits appears later in this chapter).

    The rotation axis of each joint should be consistent throughout the skeleton to ensure predictable behavior. Ideally, the red X axis should be pointing down the length of the joint, and the rotation of the green Y axis and blue Z axis should match throughout the skeleton as much as possible. For example, if the Y axis is pointing downward and the Z axis is pointing toward the rear of the skeleton throughout the arm, then when you rotate the elbow on the Y axis, positive Rotate Y values will cause the elbow to rotate inward, and negative values will cause it to rotate backward. Likewise this same arrangement will cause the fingers to use positive values in the Rotate Z channel when folding in toward the palm and to use negative values when rotating backward. The orientation of the joints at the very tips of the fingers doesn't usually matter since they won't need to be rotated or animated.

    There will be exceptions to this based on the requirements of the skeleton or your own personal preference. For the most part, consistency is the most important aspect to watch out for. Figure 7.10 shows two joints that have different rotation axes.

    The Joint Orient tool does a pretty good job of orienting the joints; however, it may have trouble orienting a joint at the root of a branch in the skeleton. In this case, you may need to manually edit the rotation of a joint. To manually change to the rotation axis of an individual joint, select the joint and switch to component mode. Right-click on the question mark selection mask icon on the status bar, and choose Local Rotation Axes (Figure 7.11). Select the axis icon, and use the Rotate tool to change the rotation axis. When you adjust the rotation axis, the wireframe sphere of the joint rotates, but the long pyramid bone shape should not move. If it does, undo the change, and make sure you are in component mode.

    Two joints with different rotation axes

    Figure 7.10. Two joints with different rotation axes

    Enable the Local Rotation Axes selection mask.

    Figure 7.11. Enable the Local Rotation Axes selection mask.

    You may decide you want a specific orientation at a point in the skeleton where a joint is a parent to two or more chains, or the joint may need to rotate on a different axis than the other joints in the chain to create a specialized type of rotation. In these cases you may need to manually rotate the local rotation axis.

    If you need precise control over the rotation of the axis, select the axis icon and use a MEL command in the script editor like the following:

    rotate -r -os 180 0 0;

    This particular MEL command rotates the local rotation axis 180 degrees around its X axis relative to its current rotation. In other words, 180 is added to the X rotation axis of the selected joint. If you need to change the orientation for a large number of joints, this small snippet of code works well as a shelf button. To make a shelf button from this line of code, select the text in the Script Editor, and choose File

    Enable the Local Rotation Axes selection mask.
  6. Save the scene as leftArm_v03.ma. To see a version of the scene to this point, open the leftArm_v03.ma scene from the chapter7scenes directory on the DVD.

Name Joints

When creating a skeleton you need to be extremely conscientious about how you name the joints. Clear, concise naming helps everyone involved in the animation understand how the rig is set up and how each joint is supposed to function. When naming joints, use a prefix such as L_ to indicate the left side and R_ to indicate the right side. If a joint is meant to be used as a control, use a suffix such as _CTRL. The advantage of being consistent with prefixes and suffixes is that you can easily search and replace the prefix or suffix if it needs to be changed on a large number of joints.

  1. Continue with the scene from the previous section or open the leftArm_v03.ma scene from the chapter7scenes folder on the DVD.

  2. Select joint1 and group it. Name the group L_ArmJoints.

  3. Shift+click the plus sign next to joint1 in the Outliner. Double-click on each joint in the Outliner, and rename each of the joints so the resulting skeleton hierarchy matches that in Figure 7.12.

  4. Save the scene as leftArm_v04.ma. To see a version of the scene to this point, open the leftArm_v04.ma scene from the chapter7scenes directory on the DVD.

    Name each of the joints in the Outliner to make its purpose clear and to keep it organized.

    Figure 7.12. Name each of the joints in the Outliner to make its purpose clear and to keep it organized.

Rotation Limits

Rotation limits specify a range of rotation for any object. Using limits is particularly useful for joints. When creating a character you can use rotation limits to prevent an elbow joint from rotating backward. This helps the animator avoid mistakes and also helps the Inverse Kinematics system solve correctly. In this example you'll set rotation limits for the arm.

  1. Continue with the scene from the previous section or open the leftArm_v04.ma scene from the chapter7scenes folder on the DVD.

  2. Select the L_forearm joint and open its Attribute Editor.

  3. Under Limit Information, expand the Rotate rollout.

  4. To set minimum and maximum limits for the joint, check the boxes next to Min and Max on either side of the Rot Limit fields.

  5. For the X rotation, set the minimum to −150 and the maximum to 150. This range is beyond the range of realistic motion, but you should always build extra room into the range so the animator can keyframe overshoot (values beyond the normal range of motion) if necessary.

  6. Activate the Min and Max ranges for Y and Z, but leave the fields set to zero (you can quickly transfer the current rotational value into the fields by clicking on the arrow buttons on either side of the Current field). This restricts the movement of the joint so it can't rotate on the Y or Z axis (see Figure 7.13).

    Create rotational limits for the forearm.

    Figure 7.13. Create rotational limits for the forearm.

    Setting a Min and Max range of 0 for a joint is preferable to locking the Rotate Y and Rotate Z channels in the Channel Box. If you lock the joint, you may run into problems later on when adding external controls via constraints.

  7. Press the arrow key to move up one joint in the chain to the L_elbow joint.

  8. Set Rot Limit X and Z Min and Max to 0. Set Rot Limit Y Min to −20 and Max to 180.

    Maya will not accept a maximum value that is lower than the minimum value, which is why it is important that the elbow uses positive values on the Y axis to rotate toward the chest. If the rotational axis for the elbow joint were flipped, you won't be able to set proper limits on the elbow to achieve the correct rotation.

  9. Save the scene as leftArm_v05.ma. To see a version of the scene to this point, open the leftArm_v05.ma scene from the chapter7scenes folder on the DVD.

Label Joints

Joint labels are another way you can organize the joints in a skeleton. You can use this as an alternative to naming the joints in the Outliner or in conjunction with it. The labels you apply to joints do not change the names of the joints. Labels are used to help Maya create a functional full-body IK system or when the animation from one skeleton is retargeted to another skeleton. If you are not using either of these solutions tools, joint labels are entirely optional. An example of Full Body IK appears later in the chapter.

  1. Continue with the scene from the previous section or open the leftArm_v05.ma scene from the chapter7scenes directory on the DVD.

  2. Expand the L_Arm Joints group in the Outliner, and select the L_collar joint. Choose Skeleton

    Label Joints
  3. You need to enable the visibility of the labels to see them in the viewport window. Choose Skeleton

    Label Joints
    Joint labels appear in the perspective view.

    Figure 7.14. Joint labels appear in the perspective view.

    Maya automatically applies labels to the joints based on the names you give the joints. However, Maya has only a certain number of available labels. If Maya encounters a joint name for which it does not have a corresponding label, it leaves the joint label as "none." You need to create a custom joint label for these joints.

  4. Select the L_forearm joint and open its Attribute Editor. Expand the Joint Labeling rollout. Set the Type menu to Other. In the Other Type field, type forearm and hit the Enter key. The joint is now labeled forearm(L) (see Figure 7.15).

    Use the Other Type option to give the forearm joint a custom label.

    Figure 7.15. Use the Other Type option to give the forearm joint a custom label.

  5. Label the other joints in the hand based on the names of the joints. Use the labels available in the Type menu, or create custom labels as needed.

    The Side menu has options for labeling the joints based on Left, Right, or Center. You can also rename the joints based on labels by choosing Skeleton

    Use the Other Type option to give the forearm joint a custom label.
  6. Save the scene as leftArm_v06.ma. To see a version of the scene to this point, open the leftArm_v06.ma scene from the chapter7scenes directory on the DVD.

Mirror Joints

The Mirror Joint command is used to instantly duplicate part of the skeleton across a specified axis. It's a time-saving device when creating symmetrical character skeletons. For example, if a joint chain is parented to part of the skeleton, or the collar bone is connected to the spine, the mirrored joint chain is parented to the same joint in the spine. In this example, you'll mirror the left arm skeleton to create a right arm.

  1. Continue with the scene from the previous section, or open the leftArm_v06.ma scene from the chapter7scenes directory on the DVD.

  2. In the Outliner, expand the L_ArmJoints group and select the L_collar joint.

  3. Choose Skeleton

    Mirror Joints

    Behavior is usually the best option when building character skeletons. When this option is enabled, corresponding joints on either side of the central axis rotate the same way. So if both shoulder joints are selected and rotated, both arms will rotate forward toward the chest, producing a mirror image across the central axis (see the left image in Figure 7.16). The Orientation option means that when corresponding joints are rotated the same amount on the same axis, one of the arms will have the opposite behavior of the other (see the right image in Figure 7.16).

    The left image shows how the Behavior option in the Mirror Joint options behaves when both joints are rotated 60 degrees in Y. The right image shows how the Orientation option behaves when both joints are rotated 60 degrees in Y.

    Figure 7.16. The left image shows how the Behavior option in the Mirror Joint options behaves when both joints are rotated 60 degrees in Y. The right image shows how the Orientation option behaves when both joints are rotated 60 degrees in Y.

  4. In the Replacement Names For Duplicate Joints section, set Search For to L and Replace With to R. This automatically renames the joint chains based on what you put in these fields. In this case, the arm joints on the character's right side use the prefix R_ instead of L_.

  5. Click the Apply button to mirror the arm.

  6. Select the new R_collar joint in the Outliner, and MMB-drag it out of the L_ArmJoints group. Group R_collar and name the group R_ArmJoints.

  7. You'll notice that the mirrored joints use the same labels as the original, including the L prefix. To quickly change this, select the R_collar joint and choose Skeleton

    The left image shows how the Behavior option in the Mirror Joint options behaves when both joints are rotated 60 degrees in Y. The right image shows how the Orientation option behaves when both joints are rotated 60 degrees in Y.
  8. Save the scene as arms_v01.ma. To see a version of the scene, open the arms_v01.ma scene from the chapter7scenes directory on the DVD.

Rename and relabel the mirrored arm joints appropriately to indicate they are on the right side of the body.

Figure 7.17. Rename and relabel the mirrored arm joints appropriately to indicate they are on the right side of the body.

Inverse Kinematic Rigs

Inverse Kinematics (IK) was introduced in Chapter 5, where you created a very simple mechanical bug using IK Handles and basic techniques. In this section, you'll explore Inverse Kinematics a little further as well as some of the specialized IK rigging tools Maya offers.

As discussed in Chapter 5, kinematics is the study of the motion of objects. There are two main types of kinematics: Forward and Inverse Kinematics. Forward Kinematics refers to a situation in which each joint in the chain inherits the motion of its parent joint. Inverse Kinematics causes the joints in a chain to orient themselves based on the position of a goal known as the End Effector. In this section, you'll learn about how to set up and use Inverse Kinematics in more detail.

IK Solvers

Maya uses several types of solvers to calculate how the bones orient themselves based on the position of the End Effector. In Chapter 5 you used the Single Chain solver (ikSCsolver), which is a very simple solver with a few controls.

In this exercise, you'll practice applying each of these types of handles in a sample scene. You can then compare how each IK solver behaves.

The Single Chain solver (ikSCsolver) uses a single IK Handle to determine both the position and orientation of the End Effector based on the position and the orientation of the IK Handle. It's good for very simple joint chains; however, the rotation of the joints can be a little unpredictable.

  1. Open the IKexamples_v01.ma scene from the chapter7 scenes directory on the DVD.

    This scene has a number of joint chains already set up; each one is grouped and placed on its own display layer. The SC_example layer is currently visible (the other layers are invisible at the moment). The layer contains four joints.

  2. From the Animation menu set, choose Skeleton

    IK Solvers
    Choose the ikSCsolver in the IK Handle Settings options.

    Figure 7.18. Choose the ikSCsolver in the IK Handle Settings options.

  3. With the IK Handle tool active, click on the root joint of the chain (the top joint), and then click again on the bottom joint. You'll see a line drawn between the first joint you clicked on and the second joint. The line is known as the IK Handle Vector. You can also see a line that runs through the joint chain (this is not easy to see in the black-and-white image in this book); this line is the Handle Wire (see Figure 7.19).

    Inverse Kinematics controls can be applied to any joints in the chain, not just between the root and the end joint.

    Attach the IK Handle to the joint chain by clicking on the two end joints in the chain. Inverse Kinematics is indicated by a line between the two selected joints.

    Figure 7.19. Attach the IK Handle to the joint chain by clicking on the two end joints in the chain. Inverse Kinematics is indicated by a line between the two selected joints.

  4. In the Outliner, expand the singleChainExampleJoints group. You'll see that a node named effector1 has been added at the end of the chain. Also, a node named ikHandle1 appears in the Outliner.

  5. Switch to the perspective view, select ikHandle1 in the Outliner, and move it around. Notice how the joint chain reacts. Notice also that in some positions the joints flip around to try to match the position of the IK Handle.

    The two main settings for the IK Handle are Sticky and Snap Enable. When Snap Enable is on, the IK Handle snaps back to the end joint. The Sticky setting keeps the joints oriented toward the goal when the root joint is moved. This is very useful for legs, as it keeps the feet from sliding on the floor.

    To animate a joint chain with Inverse Kinematics, you set keyframes on the IK Handle, not the joints. In most situations, you'll want to constrain the IK Handle to a locator or another type of control object, such as a curve. The control is keyframed, and the IK Handle is constrained to the control so that it inherits the animation of the control. This is explained further later in the chapter; for now the exercise focuses on how to create the handles and edit their settings.

  6. Select the ikHandle1 node and open its Attribute Editor. Set the Stickiness setting to Sticky. In the Outliner, select joint1 and move the joint around; note how the chain remains oriented toward the IK Handle.

    The Rotate Plane solver (RP solver) differs from the Single Chain solver in that the End Effector matches the position of the IK Handle but not the rotation. Instead the rotation of the chain is controlled using a special disc-shaped manipulator that can be keyframed if needed. The RP solver is more predictable and used most often, especially when creating skeletons for characters.

  7. Turn on the visibility of the RP_example layer. Repeat step 2 to create an IK Handle for this chain between the root and the tip. However, in the options for the IK Handle, set the solver to ikRPsolver.

    The RP solver is similar to the SC solver except that an additional circular icon appears indicating the pole vector for the chain. The pole vector determines the direction of rotation for the joints as they attempt to reach the IK Handle (see Figure 7.20).

    You can select the IK Handle (ikHandle2 in the example) and turn on the Show Manipulators tool. Using the tool you can rotate the blue disc to adjust the rotation of the chain, and you can change the numeric values in the Channel Box using the Twist channel (see Figure 7.21).

    The Pole Vector of the chain is indicated by the white triangle in the rotate plane indicator at the start point of the IK chain. Changing the pole vector also changes the orientation of the chain. The Pole Vector determines the angle of the rotate plane for the RP solver. This can be used to control unwanted flipping while animating the IK Handle.

    The Twist attribute is directly related to the Pole Vector. In general, you'll want to adjust the Pole Vector to properly orient the chain and then use the Twist attribute to solve any flipping problems you may encounter while animating.

    The RP solver adds an additional control to determine how the chain rotates as it attempts to match the position of the IK Handle.

    Figure 7.20. The RP solver adds an additional control to determine how the chain rotates as it attempts to match the position of the IK Handle.

    You can adjust the orientation of a joint chain using the ikRPsolver by changing the Pole Vector and the Twist settings in the IK Handle attributes.

    Figure 7.21. You can adjust the orientation of a joint chain using the ikRPsolver by changing the Pole Vector and the Twist settings in the IK Handle attributes.

    IK Spline Solver uses a curve to control the rotation of the joints. This is ideal for long snaking chains and tails. The solver can generate a curve or use an existing curve. The CVs of the curve become the manipulators for the joint chain. Usually it's a good idea to create clusters for the CVs of the curve and animate CVs of the curve indirectly using the clusters.

  8. In the Outliner, select ikHandle1 and add it to the SC_example layer. Select ikHandle2 and add it to the RP_example layer. Turn off Visibility for both layers, and turn on Visibility for IKSpline_example layer. The ikSpline handle layer contains a joint chain and a curve.

  9. Choose Skeleton

    You can adjust the orientation of a joint chain using the ikRPsolver by changing the Pole Vector and the Twist settings in the IK Handle attributes.
  10. With the tool active, click on the first joint in the chain, the last joint in the chain, and then the curve. The joint chain jumps to the curve.

  11. Right-click on the curve and choose CVs. Try moving the CVs of the curve around; the joint chain sticks to the curve, inheriting the changes you make to the curve.

  12. Select the curve and switch to the Surfaces menu set. Choose Edit Curves

    You can adjust the orientation of a joint chain using the ikRPsolver by changing the Pole Vector and the Twist settings in the IK Handle attributes.
    The ikSpline Handle tool attaches the joint chain to a curve. The CVs of the curve are animated using cluster deformers.

    Figure 7.22. The ikSpline Handle tool attaches the joint chain to a curve. The CVs of the curve are animated using cluster deformers.

  13. In the Outliner, select ikHandle3. This is the IK Handle for the ikSpline. In the Channel Box, adjust the Offset channel to slide the joint chain up and down the curve. Use Twist to twist the joints around the curve and Roll to change the rotation around the curve.

  14. Select the clusters and ikHandle3. Add these to the IKSpline_example layer, and turn off this layer.

    Full Body IK (FBIK) is used for Full Body IK skeletons. This system creates IK Handles that control an entire biped or quadruped skeleton rather than using multiple IK chains on individual limbs.

  15. Switch back to the Animation menu set. Turn on the FBIK_example layer.

    In this layer you'll see a simple skeleton. The joints of the skeleton have labels applied, which are displayed when you select the skeleton and choose Skeleton

    The ikSpline Handle tool attaches the joint chain to a curve. The CVs of the curve are animated using cluster deformers.
  16. In the Outliner, expand the FBIKExampleJoints group, and select the hips joint. Choose Skeleton

    The ikSpline Handle tool attaches the joint chain to a curve. The CVs of the curve are animated using cluster deformers.

    When you add Full Body IK, a group called humanIK1 is added to the scene as well as a character node named fbikCharacter. The character node is used with the Trax Editor for non-linear animation. For more information on the Trax Editor consult the Non-Linear Animation PDF included on the DVD.

  17. Expand the humanIK1 group, and select one of the Eff nodes, such as the LeftFootEff. Use the Move tool to drag the node around. You'll see that the entire skeleton reacts to the change in position (see Figure 7.23).

    Full Body IK creates Inverse Kinematics for the entire skeleton.

    Figure 7.23. Full Body IK creates Inverse Kinematics for the entire skeleton.

    Maya has two examples of full rigged FBIK skeletons available in the Visor. Open the Visor window (Window

    Full Body IK creates Inverse Kinematics for the entire skeleton.

    Two Bone solver (2B solver) is a variation of the Rotate Plane solver that is meant for chains consisting of two bones. Bones are the pyramid shapes between joints, so a two-bone chain uses three joints. The Two Bone solver needs to be loaded manually into Maya before it is available as an option in the IK Solver Attributes section.

  18. Add the humanIK group to the FBIK_example display layer. Hide this layer and turn on the Visibility of the twoBone example.

  19. Before you can add a Two Bone IK system to the joints, you need to load the ik2Bsolver. To do this, type ik2Bsolver; into the command line, as shown in Figure 7.24, and hit the Enter key.

  20. Choose Skeleton

    Full Body IK creates Inverse Kinematics for the entire skeleton.
    You must load the ik2Bsolver before it can be selected from the IK Handle Tool options.

    Figure 7.24. You must load the ik2Bsolver before it can be selected from the IK Handle Tool options.

    The Multi-Chain solver is a series of single-chain solvers that can be used for complex skeleton rigs. Like the Two-Bone solver, it is not available in Maya unless you load it manually.

  21. Turn on the Visibility for the MC_example layer. This layer has a long series of joints. In the command line, type createNode ikMCsolver; and press the Enter key.

    When you create this node, it does not appear in the options for the IK Handle tool; instead you need to use a single-chain solver or an RP solver and then switch the solver type in the Attribute Editor.

  22. Use the IK Handle tool to create three overlapping IK Handles in the series of joints, as shown in Figure 7.25.

  23. Select each of the new IK Handles (they should be named ikHandle5, ikHandle6, and ikHandle7), and open their Attribute Editor. Set the solver for each of these to ikMCsolver1 (see left image, Figure 7.26).

    The same ikMCsolver node is used to solve all three IK Handles. You can use the Priority and Weight settings in the IK Handle Attributes section of each handle's Attribute Editor to determine the amount of influence each handle has over the chain (see right image, Figure 7.26). This allows you to create complex motion using a few controls. If you use more than one Multi-Chain IK rig in a scene, you need to create more than one ikMCsolver and select the appropriate solver for each IK Handle in each chain.

    Add three overlapping IK Handles to the joint chain.

    Figure 7.25. Add three overlapping IK Handles to the joint chain.

    Select the ikMCsolver1 node in the Attribute Editor for the IK Handles. Then you can set Weight and Priority for each handle in the chain.

    Figure 7.26. Select the ikMCsolver1 node in the Attribute Editor for the IK Handles. Then you can set Weight and Priority for each handle in the chain.

    Spring IK solver creates a handle that adds a springlike motion to a series of joints. It accomplishes this by rotating each joint proportionally as the IK Handle is moved. You need to load this solver manually.

  24. Add ikHandle5 through ikHandle7 to the MC_example display layer, and turn off Visibility for this layer. Turn on Visibility of the spring_example layer.

  25. In the command line, type ikSpringSolver; and hit the Enter key. Choose Skeleton

    Select the ikMCsolver1 node in the Attribute Editor for the IK Handles. Then you can set Weight and Priority for each handle in the chain.
  26. Click on the first joint in the chain and the last joint in the chain to create the handle.

  27. Select ikHandle8 in the Perspective window and move it back and forth. The joint chain has an accordionlike behavior.

  28. Select ikHandle8 and open its Attribute Editor. Expand the IK Spring Solver Attributes rollout. You'll see an edit curve, which allows you to adjust the bias for each joint in the chain (see Figure 7.27).

  29. Save the scene as ikExamples_v02.ma. To see a version of the scene, open the ikExamples_v02.ma scene from the chapter7scenes folder on the DVD.

You can change the bias for each joint in the ikSpring- Solver using the edit curve in the Attribute Editor for the IK Handle.

Figure 7.27. You can change the bias for each joint in the ikSpring- Solver using the edit curve in the Attribute Editor for the IK Handle.

Creating a Custom Control

An ideal animation rig should be easy to understand and animate. This means the controls should be clearly labeled and easy to select directly in the viewport window. When using Inverse Kinematics, the animator should be able to enter 0 in all of the translation channels for the controls to return the rig to the start position if needed. IK Handles use world space coordinates, so setting their translation channels to 0 moves a handle to the origin. One common solution to this problem is to constrain the handle to a locator, which can then be used to animate the handle. You can set a start position for the control and then freeze transformations on it so that when the translation channels are set to 0, the control moves to the start position and brings the IK Handle along.

In addition, you can add custom controls to the locator to animate other attributes of the IK Handle so the animator does not need to hunt through the various nodes in the scene to animate the rig.

  1. Open the leftArm_v07.ma scene from the chapter7scenes directory on the DVD. This is the same left arm skeleton created earlier in the chapter.

    You're going to create an IK Handle to control the arm. The arm has been created using a single bone for the upper arm and two bones for the forearm. Two bones are used for the forearm to simulate a realistic wrist rotation where the radius and ulna bones rotate around each other.

    If you add an IK Handle from the upper arm joint to the wrist, the IK will interfere with your ability to properly rotate the forearm joints. To solve this problem, use an IK Handle to connect the upper arm to the forearm joint and then reposition the End Effector so that manipulating this IK Handle is natural.

  2. Choose Skeleton

    Creating a Custom Control
  3. Click on the L_shoulder joint (the second joint in the chain) and the L_forearm joint (the fourth joint in the chain) to create the handle (see Figure 7.28).

    An IK Handle connects the L_shoulder joint and the L_forearm joint.

    Figure 7.28. An IK Handle connects the L_shoulder joint and the L_forearm joint.

  4. In the Outliner, Shift+click the L_ArmJoints group to expand the skeleton. In the skeleton, select effector1.

  5. Turn on Point Snapping and select the Move tool. Hold the d key to switch to pivot-positioning mode. Snap the Effector to the L_wrist joint, as shown in Figure 7.29.

    Snap the pivot point of the Effector to the wrist joint.

    Figure 7.29. Snap the pivot point of the Effector to the wrist joint.

    If you select the ikHandle1 node and move it around, the arm moves as if the IK Handle was placed at the wrist joint. However, if you rotate the L_forearm joint around the X axis and then move the IK Handle, the rotation of the forearm is not affected by the IK Handle as it would be if the IK Handle was connected to the wrist joint.

  6. Undo any changes made to the position of IK Handle so the arm returns to the position it was in at the end of step 5. Create a locator in the scene, and name it L_arm_CTRL.

  7. Turn on Point Snapping, and snap this locator to the L_wrist joint, the same joint where you placed the Effector.

  8. In the Outliner, select the L_arm_CTRL and Ctrl+click the L_collar joint. Press the p hot key to parent L_arm_CTRL to the L_collar joint. Choose Modify

    Snap the pivot point of the Effector to the wrist joint.
  9. In the Outliner, select the L_arm_CTRL locator, and Ctrl+click ikHandle1. Choose Constrain

    Snap the pivot point of the Effector to the wrist joint.
  10. Try moving the L_arm_CTRL locator around the scene. You want to keyframe the locator, not the IK Handle, when animating the arm. To return it to the start position, set the Translate channels to 0.

    To make things easier for animation you can add custom attributes to L_arm_CTRL to control the rotation of the forearm.

  11. Select L_arm_CTRL and open its Attribute Editor. In the Attribute Editor menu, choose Attributes

    Snap the pivot point of the Effector to the wrist joint.
  12. Open the Channel Box for L_arm_CTRL, and you'll see the new channel named Forearm Rotate (Maya adds a space and capitalization to the channel names; see Figure 7.31).

    Use the Add Attribute window to create custom attributes for nodes.

    Figure 7.30. Use the Add Attribute window to create custom attributes for nodes.

    The custom attribute Forearm Rotate appears in the Channel Box.

    Figure 7.31. The custom attribute Forearm Rotate appears in the Channel Box.

  13. Choose Window

    The custom attribute Forearm Rotate appears in the Channel Box.
  14. On the left side of the Connection Editor, scroll to the bottom and choose forearmRotate from the list. On the right side of the Connection Editor, expand the rotate attributes and select rotateX (see Figure 7.32).

  15. Close the Connection Editor. Select the L_arm_CTRL locator, and adjust the values for the Forearm Rotate Channel to test the attributes.

  16. Save the scene as leftArm_v08.ma. To see a version of the scene, open the leftArm_v08.ma scene from the chapter7scenes directory on the DVD.

Connect the forearmRotate attribute on the L_arm_CTRL to the rotateX of the L_forearm joint.

Figure 7.32. Connect the forearmRotate attribute on the L_arm_CTRL to the rotateX of the L_forearm joint.

Pole Vector Constraint

A Pole Vector constraint can be used to constrain the Pole Vector of an IK chain to the position of a control such as a locator.

  1. Continue with the scene from the previous section or open the leftArm_v08.ma scene from the chapter7scenes folder on the DVD.

  2. Create a locator and name it L_armPV_CTRL.

  3. Point snap the locator to the position of the L_elbow joint. Once it is in position, use the Move tool to move the locator back along the Z axis one or two units, just enough so the locator is easy to see and select.

  4. Parent L_armPV_CTRL to the L_collar joint, and then freeze transformations for L_armPV_CTRL.

  5. In the Outliner, select L_armPV_CTRL and Ctrl+click ikHandle1. Choose Constrain

    Pole Vector Constraint

    A line appears between the IK Handle and L_armPV_CTRL, as shown in Figure 7.33.

    If you select L_armPV_CTRL and move it up or down along the Y axis, you'll see the elbow adjust its position. Moving along the Z axis causes the joints to flip. You may want to set Translation Limits on the L_armPV_CTRL locator so it cannot be moved on the X axis and its range of movement is limited along the Y and Z axes.

  6. Save the scene as leftArm_v09.ma. To see a version of the scene, open the leftArm_v09.ma scene from the chapter7scenes directory on the DVD.

Use a Pole Vector constraint to control the Pole Vector of the arm's IK Handle.

Figure 7.33. Use a Pole Vector constraint to control the Pole Vector of the arm's IK Handle.

FK/IK Blending

You can use both Forward and Inverse Kinematics on the same rig and blend between the two types of controls using FK/IK blending. This short exercise demonstrates how.

  1. Continue with the scene from the previous section or open the leftArm_v09.ma scene from the chapter7scenes folder on the DVD.

  2. Set the timeline to 100 frames; then set the current frame to frame1. Select L_arm_CTRL. In the Channel Box, Shift+click the Translate channels, right-click, and choose Key Selected.

  3. Turn on Auto Keyframe by clicking the key icon to the right of the timeline.

  4. Set the timeline to various frames, and reposition the L_arm_CTRL locator to create a short animation of the arm moving around.

    Now that you have an animation created using Inverse Kinematics, you'll create another animation for the arm using Forward Kinematics.

  5. Rewind the timeline to the start of the animation. In the Outliner, select the ikHandle1 node. Choose Skeleton

    FK/IK Blending
  6. Select the L_shoulder joint and Shift+click the L_elbow joint.

  7. In the Channel Box, set a keyframe for the rotation channels of both joints.

  8. Set the timeline to various frames in the animation, and rotate the L_shoulder and L_forearm joints to create an animation. As long as Auto Keyframe is enabled, keyframes will automatically be generated each time you rotate the joints.

  9. Rewind the scene and select the ikHandle1 node. Choose Skeleton

    FK/IK Blending

    In the Channel Box for the ikHandle1 node there is an attribute called IK Blend. When IK Blend is set to 1, the arm uses the animation created with Inverse Kinematics. When IK Blend is set to 0, the arm uses the animation created using Forward Kinematics. Values between 0 and 1 blend the two animations. When you play the animation you can see "ghosted" versions of the joints. The blue joints represent the FK animation, and the brown joints represent the IK animation (see Figure 7.34). This ghosting is visible only when the ikHandle node is selected.

  10. Save the scene as leftArm_v10.ma. To see a version of the scene, open the leftArm_v10.ma scene from the chapter7scenes directory on the DVD.

The IK Blend channel allows you to blend between animation created using Inverse Kinematics and animation created using Forward Kinematics.

Figure 7.34. The IK Blend channel allows you to blend between animation created using Inverse Kinematics and animation created using Forward Kinematics.

Skinning Geometry

Skinning geometry is the process in which geometry is bound to joints so that as the joints are rotated or translated, the geometry is deformed. The terms skinning and binding are interchangeable. There are two types of skinning: Smooth Binding and Rigid Binding. Although Rigid Binding is available as an option, it is rarely used, so this section focuses on Smooth Binding.

Polygon and NURBS geometry can be bound to skeletons; however, polygon geometry often produces more predictable results. In this section, you'll use polygon geometry.

When geometry is Smooth Bound to a skeleton, each vertex of the geometry receives a certain amount of influence from the joints in the skeleton. The amount of weight value of the joints determines the amount of influence each vertex receives from a joint. The values range from 0 to 1, where 0 is no influence and 1 is full (or 100 percent) influence. When you bind geometry to a skeleton, the vertex weights are set automatically based on the options you specify in the Smooth Bind command. In most situations the weights of the geometry require further editing after executing the Smooth Bind command.

When binding geometry to the skeleton, make sure the rotations of the joints in the skeleton are all at 0. This means that if an IK Handle has been added to the skeleton, you should select and disable the handle (choose Skeleton

Skinning Geometry

The pose the skeleton is in when you bind the geometry is known as the bind pose. If you need at some point to detach and reattach the geometry to edit the geometry, you will need to be able to easily return to the bind pose. Do this by selecting the skeleton's root joint and choosing Skin

Skinning Geometry

Editing the skin weights is accomplished using the Paint Skin Weights tool, which employs the Artisan brush interface to interactively set weights. You can also edit the weight values directly for selected vertices using the Component Editor. Editing skin weights can be a difficult and occasionally frustrating process. In the following exercise you'll learn a few tips that can help make the process a little easier and faster.

Smooth Binding

Maya automatically assigns skin weights to each vertex of the geometry as it is bound to the joints. There are options for assigning these weights based on the vertices' proximity to the joints and the number of joints that can influence any particular vertex. Even so, after binding you'll need to edit the weights using the Paint Skin Weights tool. If the geometry is very dense, meaning it has a lot of vertices, this process can take a while.

There is a trick to make the process of skinning a little faster and easier. To accomplish this you will need a low resolution of the model. The low-resolution version can be extremely simple; in fact, you can reduce the number of edges on the model so there are edges only in the areas where the model bends (such as the shoulder, elbow, and wrist). Parts of the model between these areas can be reduced to just the edges needed to define the basic shape of the model (see Figure 7.35).

You can create a low-resolution copy of the arm geometry in the high-resolution version.

Figure 7.35. You can create a low-resolution copy of the arm geometry in the high-resolution version.

The process works like this: Skin the low-resolution version of the model to the joints, edit the weights on the low-resolution version of the model, skin the high-resolution version of the model to the joints, and then copy the joint weight from the low-resolution version to the high-resolution version. The weights copied to the high-resolution version require further editing, but in most cases the time spent editing these weights is less than if you had directly skinned the high-resolution version to the joints. To see this process in action, follow this exercise, which uses the arm joints as an example.

  1. Open the leftArm_v11.ma scene from the chapter7scenes directory on the DVD.

    This version of the scene has both the low-resolution version of the arm and the same arm model that has been used in the other examples. The low-resolution version is on a display layer named lowResolutionMesh, and the other version of the arm is on the armMesh layer.

  2. Turn off Visibility of the armMesh layer, and make sure the lowResolutionMesh layer is visible.

    Before binding the joints to the geometry, double-check to make sure all the rotation channels of the joints are at 0.

  3. In the Outliner, Shift+click the plus sign next to the L_armJoints group to expand it, and select the L_collar joint. Ctrl+click the leftArm_loResolution surface. From the Animation menu set, choose Skin

    You can create a low-resolution copy of the arm geometry in the high-resolution version.
  4. In the options, choose Edit

    You can create a low-resolution copy of the arm geometry in the high-resolution version.
    Bind the lowresolution arm to the selected joint hierarchy.

    Figure 7.36. Bind the lowresolution arm to the selected joint hierarchy.

    Notice that you can choose to bind the entire joint hierarchy or just selected joints. In this example you'll bind the entire hierarchy. Keep in mind that you also have the option of binding only selected joints. In some circumstances this can be quite useful. For example, if you set up what is known as a broken-joint skeleton, which uses additional bones outside of the main skeleton hierarchy as deformers, these additional joints are usually constrained to the main hierarchy using parent constraints. By using parent constraints the joints "float" outside of the main hierarchy, giving them a level of freedom of movement to create special deformation effects. (Sometimes floating joints are used for facial animation instead of or in addition to blendshape deformers.) When skinning a broken rig to the skeleton, select the floating joints along with the joints in the main hierarchy when the Smooth Bind operation is performed.

  5. Once the skin is bound, select the IK Handle and move it around; the geometry should now move with the bones(see Figure 7.37.

  6. Save the scene as leftArm_v12.ma. To see a version of the scene, open the leftArm_v12.ma scene from the chapter7scenes directory on the DVD.

Once you bind the geometry to the skin, it is deformed when you move the joints.

Figure 7.37. Once you bind the geometry to the skin, it is deformed when you move the joints.

Paint Skin Weights

When the joints are moved it becomes immediately obvious that the geometry of the skin does not move in a realistic manner. To make the skin move properly, you need to edit the weight values of the vertices; this can be done with the Paint Weights tool. This exercise demonstrates techniques for painting weights on the low-resolution version of the arm.

  1. Continue with the scene from the previous section or open the leftArm_v12.ma scene from the chapter7scenes directory on the DVD.

  2. In the viewport, switch to smooth-shaded mode (hot key = 6). Select the leftArm_loResolution and choose Skin

    Paint Skin Weights

    The geometry turns black except for the area around the joint listed in the Influence section of the Paint Skin Weights Tool window. The geometry is color coded. White indicates a joint weight value of 1 (100 percent), and black indicates a joint weight value of 0. Shades of gray indicate values between 0 and 1 (see Figure 7.38).

    The Paint Skin Weights tool color-codes the geometry based on the amount of weight influence each joint has for each vertex of the skinned geometry.

    Figure 7.38. The Paint Skin Weights tool color-codes the geometry based on the amount of weight influence each joint has for each vertex of the skinned geometry.

    The Paint Skin Weights tool uses the Artisan brush interface. As you paint on the model, the operation selected in the Paint Weights section determines how the brush edits the weights. You can replace, add, smooth, or scale weights in the areas you paint on the model. The easiest way to approach weight painting is to stick to only the Add and Smooth operations.

    Each vertex on the model receives up to a value of 1 from all the joints on the model. The total weight values must equal 1, so if a selected vertex receives a value of 0.8 from a particular joint, the remaining weight value (0.2) must come from another joint in the chain. Usually this remaining weight value comes from a joint close by the vertex as determined by Maya. This is where things can get tricky. If you paint on a vertex using the Replace operation with a value of 0.5 for a particular joint, the remaining 0.5 weight value is distributed among the other joints in the chain, which can lead to some strange and unpredictable results. If instead you use the Add operation with very low values, you can carefully increase a joint's influence over a vertex without worrying about Maya assigning the remaining weight values to other joints in the chain.

  3. In the Influence section of the Paint Skin Weights Tool options, select the L_collar joint from the list. In the Paint Weights section, set Paint Operation to Add and Value to 0.05 (Figure 7.39).

  4. Lightly paint over the areas near the open end of the arm past the shoulder. As the color becomes brighter, the influence of the L_collar joint increases.

  5. Select the L_arm_CTRL locator, and move it in to bend the arm. Select the arm geometry, and go back to the Paint Skin Weights tool.

    You can continue to paint the skin weights with the joints posed. This is an excellent way to get visual feedback as you edit the weights.

  6. To reduce the pinching in the elbow area, switch back and forth between the L_shoulder and L_elbow joints in the Paint Skin Weights Tool options. As you switch between the two, paint the vertices near the elbow. You'll see the vertices move as the influence from the joints increases as you paint (Figure 7.40).

    The options for the Paint Skin Weights tool

    Figure 7.39. The options for the Paint Skin Weights tool

    Pose the arm while you edit the skin weights with the Paint Skin Weights tool.

    Figure 7.40. Pose the arm while you edit the skin weights with the Paint Skin Weights tool.

  7. Continue to paint and adjust the weights of the low-resolution arm. Your goals are to reduce the compression of the geometry that occurs when the joints are rotated and to reduce movement at the open end of the geometry that occurs when the arm is repositioned (Figure 7.41). As much as possible, try to create a crease in the skin where a joint is at an extreme pose.

  8. Save the scene as leftArm_v13.ma. To see a version of the scene to this point, open the leftArm_v13.ma scene from the chapter7scenes directory on the DVD.

Paint the weights of the skin to create creases where the joints bend.

Figure 7.41. Paint the weights of the skin to create creases where the joints bend.

Edit Skin Weights in the Component Editor

In some cases you may want to edit the skin weights by entering a precise numeric value. To do this, switch to component mode and select the vertices you need to edit directly. Then choose Window

Edit Skin Weights in the Component Editor
You can use the Component Editor to enter numeric weight values for the joints.

Figure 7.42. You can use the Component Editor to enter numeric weight values for the joints.

Copy Skin Weights

You can copy the weights from the low-resolution model to the high-resolution model. It does not matter that the vertices do not perfectly match because the overall weighting can easily be transferred. This reduces the difficulty of editing the initial weights on the high-resolution model.

  1. Continue with the scene from the previous section or open the leftArm_v13.ma scene from the chapter7scenes directory on the DVD.

  2. Make sure that the L_arm_CTRL locator is back to its starting position (set the Translate channels to 0). Make sure all Rotate channels for each joint are set to 0.

  3. Turn on the armMesh layer's Visibility. Use Smooth Binding to skin the leftArm geometry to the arm joints using the same steps from the "Smooth Binding" section in this chapter.

  4. Once the geometry is bound to the joints, select the leftArm_loResolution geometry, and then Ctrl+click the leftArm geometry. Choose Skin

    Copy Skin Weights
  5. In the Copy Skin Weights Options window, set Surface Association to Closest Point On Surface. Set Influence Association 1 to Label, Influence Association 2 to Name, and the Influence Association 3 to One To One (see Figure 7.43).

  6. Click Apply to copy the weights. When the weights have been copied, you can hide the lowResolutionMesh display layer.

    Use the Paint Weights tool to fine-tune the weights of the high-resolution mesh. The fingers will need some work to make them look more realistic as the finger joints rotate.

  7. Switch to wireframe mode, and select the joints of the index finger (Shift+click L_index3, L_index2, and L_index1, in that order). Rotate the joints so they face inward toward the palm.

  8. Use the Paint Skin Weights tool to adjust the weights on each section of the finger to create a more realistic behavior in the bent finger. The flesh should bulge slightly as the finger bends (Figure 7.44).

    The options for the Copy Skin Weights operation

    Figure 7.43. The options for the Copy Skin Weights operation

    Paint the weights of the skin on the fingers to create realistic bulges in the flesh as the fingers bend.

    Figure 7.44. Paint the weights of the skin on the fingers to create realistic bulges in the flesh as the fingers bend.

    You can interactively change the size of the brush by holding the b hot key while dragging left and right. This helps when painting in tight spaces.

  9. Save the scene as leftArm_v14.ma. To see a version of the scene to this point, open the leftArm_v14.ma scene from the chapter7scenes directory on the DVD.

Mirror Skin Weights

You can copy weight values from one side of a symmetrical character to another using the Mirror Skin Weights command. This greatly reduces the amount of time spent painting weights and ensures consistency in weighting for both sides of a character. To do this, select the mesh and choose Skin

Mirror Skin Weights

Maya Muscle System

Maya Muscle is a new addition to the Maya rigging toolset. Maya Muscle (formerly known as cMuscleSystem) has been used in the industry for several years as a Maya plug-in for the realistic deformations of characters. Maya Muscle was first introduced as an extension to Maya 2008. The plug-in was originally developed by Michael Comet for his own company, Comet Digital LLC. Autodesk purchased the plug-in to integrate it into Maya. In Maya 2009 the integration is complete.

Maya Muscles deform the surface of geometry much like other types of deformers. They simulate the behavior of actual muscles and can be driven by the rotation of joints or expressions. Muscles are similar to Maya's influence objects, but they offer better control for deforming the skinned geometry surface. Much of the purpose and functionality of influence objects are replaced by Maya Muscle so this edition of Mastering Maya does not discuss influence objects.

The Maya Muscle deformer is actually a surface that can be manipulated while connected to the deformed geometry. The muscle objects can create complex deformation by allowing for multiple end shapes per muscle.

Muscle objects can slide beneath the deformed geometry to create special effects, and muscles also have properties that allow movement such as jiggle, force, and collision.

The Maya Muscle System

The Maya Muscle system is a collection of deformation tools that can work independently or in concert to deform geometry so it looks like muscles are bulging and stretching beneath skin. The primary system has three main deformer types: capsules, bones, and muscles.

Capsules are very simple skin deformers used as replacement for Maya's joints. It is necessary to use capsules because standard Maya joints cannot work directly with the muscle deformer. Capsules are shaped like a simple pill. The basic capsule shape cannot be changed. However, it can be scaled to simulate the basic shape of muscles (see Figure 7.45).

Bones are skin deformers that have been converted from regular polygon geometry. Because of this, bones can be almost any shape you need. The term bones in this sense should not be confused with Maya's standard bones, which are the shapes that connect joints. The reason the Maya Muscle system uses the term bones is because these deformers are useful for simulating the movement of specially shaped bones—such as the scapula—beneath skin.

A capsule is a simple deformer that appears in the shape of a pill.

Figure 7.45. A capsule is a simple deformer that appears in the shape of a pill.

Muscles are skin deformers created from NURBS surfaces. The muscle deformers are designed to replicate the behavior of real-life muscles. To achieve this, they have two connection points at either end, which are attached to the character's rig. So, for example, when the character moves/bends his arm, the connection points move closer together, creating a bulging/squashing effect. When the character extends his arm, the connection points move farther apart, creating a stretching effect. The transition between squashing and stretching is automatically eased in and out, so the deformer's movements are very smooth.

Any of these muscle deformers can be bound to the character's skin geometry using one of the various types of weighting available. Weighting muscle deformers to geometry is similar to using Smooth Binding to connect geometry to Maya joints. The weighting types include Sticky, Sliding, Displacement, Force, Jiggle, Relax, and Smooth. The following sections demonstrate using muscle deformers with Sticky Weighting, which is very similar to Smooth Binding, discussed earlier in the chapter.

To use a muscle system you must first create the muscle objects (capsule, bone, or muscle), apply the muscle deformer to the character's skin, connect the specific muscle objects (capsule, bone, or muscle) to the deformer, and then use a weighting type to bind it to determine how the deformer affects the character's skin using one of the available weighting types.

It is important to understand that when you use the Maya Muscle system, the character's skin geometry must be bound to objects that have the cMuscleObject shape node. In other words, you must either replace or convert any existing joints with capsules or Maya Muscle bones. You can also transfer any existing skin weights created for Maya joints to the muscle system.

In the following exercises, you'll add the Maya Muscle system to the left arm rig created earlier in the chapter.

Using Capsules

Capsules are very similar to Maya joints except their shape can be used to influence the deformation of the character's skin geometry. It's also necessary to replace existing joints with capsules or polygon bones to use the Maya Muscle deformer.

  1. Open the leftArmCapsule_v01.ma scene from the chapter7scenes directory on the DVD.

    This scene contains the left arm rig created earlier in the chapter. The geometry includes the left arm as well as part of the left side of a character's chest. The geometry is Smooth Bound to the rig, and the weights for the joints have been painted onto the model.

    The Maya Muscle plug-in may not be loaded. If you do not see the Muscle menu in the Animation menu set, then you'll need to load the plug-in using the Plug-in Manager.

  2. Choose Window

    Using Capsules
  3. Once the plug-in is loaded, you should see the Muscle menu in the Animation menu set (the Muscle menu actually appears in all of the menu sets; for the moment though, you should be using the Animation menu set).

  4. In the Outliner, expand the L_ArmJoints group. Select the root joint. Right-click on the root joint in the perspective view, and then from the pop-up window choose Select Hierarchy. This is a quick way to select all of the joints in the hierarchy (see Figure 7.47).

    Load the Maya Muscle plug-in in the Plug-in Manager.

    Figure 7.46. Load the Maya Muscle plug-in in the Plug-in Manager.

    Use the pop-up menu to select all the joints in the left-arm hierarchy.

    Figure 7.47. Use the pop-up menu to select all the joints in the left-arm hierarchy.

  5. In the Outliner, Ctrl+click on any of the objects that are not joints, such as effector1, L_arm_CTRL, and L_armPV_CTRL. By Ctrl+clicking on these objects, they become deselected without affecting the nodes that are selected in the hierarchy. You should end up with only joints selected in the Outliner.

  6. With only the joints selected, choose Muscle

    Use the pop-up menu to select all the joints in the left-arm hierarchy.

    It is important to make sure that the joints are oriented properly. We discussed this earlier in the chapter in the section titled "Orient Joints." In the example scene, the joints have been oriented so the X axis points along the length of the bone toward the child joint.

  7. When you execute the conversion command, you'll be asked to specify which axis points down the length of the joints. This is used to orient the capsules. Since the joint rig is set up to use the X axis, choose X-Axis from the pop-up window (see Figure 7.48).

    Maya asks you to specify the axis that points down the length of the joint.

    Figure 7.48. Maya asks you to specify the axis that points down the length of the joint.

    The joints are converted to capsules. You can clearly see them if you disable the Polygon option in the viewport's Show menu and switch to shaded view. The Inverse Kinematic controls still work just fine (see Figure 7.49).

  8. Save the scene as leftArmCapsule_v02.ma. To see a version of the scene, open leftArmCapsule_v02.ma.

Converting joints to capsules is the easiest way to prepare an existing rig for use with Maya Muscle. The Convert Surface To Muscle/Bone command works only on selected joints and surfaces. You can also create individual capsules using the Muscle/Bones

Maya asks you to specify the axis that points down the length of the joint.
Convert the joints to capsules. The Inverse Kinematic controls created earlier still work.

Figure 7.49. Convert the joints to capsules. The Inverse Kinematic controls created earlier still work.

Edit Capsule Shape

You can edit the attributes of the capsule in the SHAPES section of the capsule's Channel Box.

  1. Continue with the scene from the previous section or open the leftArmCapsule_v02.ma scene from the chapter7scenes directory on the DVD.

  2. In the Outliner, expand the L_ArmJoints group and select the L_collar node.

  3. In the Channel Box, select the L_collarShape node in the SHAPES section. The channels here control how the capsule is displayed and behaves. Many of these options are also used for the other types of muscle deformers.

  4. Set the Radius of the L_collarShape to 0.3 and the Length to 4.5, as shown in Figure 7.50. These settings control how the capsule is displayed but do not affect how it behaves with regard to deforming the surface.

    The settings at the bottom of the Channel Box determine the display quality of the capsule. The NSegs and NSides settings change the number of divisions in the capsule, but these settings do not affect how the capsule deforms the skin. NSegs sets the number of radial segments in the capsule; NSides sets the number of divisions around the radius of the capsule.

  5. Spend a few minutes editing the size of capsules. Use a small radius size for the capsules. In the next sections you'll add more bone deformers. By using a small radius size you can clearly see how the parts work together.

  6. Save the scene as leftArmCapsule_v03.ma. To see a version of the scene, open the leftArmCapsule_v03.ma from the chapter7scenes directory on the DVD.

Adjust the size of the capsules using the settings in the Channel Box.

Figure 7.50. Adjust the size of the capsules using the settings in the Channel Box.

Create a Muscle Using Muscle Builder

The Muscle Builder interface is designed to make the creation of muscle deformers easy and fast. In this section, you'll create the bicep for the arm rig using the Muscle Builder window.

  1. Continue with the scene from the previous section or open the leftArmCapsule_v03.ma scene from the chapter7scenes directory on the DVD.

  2. Choose Muscle

    Create a Muscle Using Muscle Builder

    This interface allows you to create and edit simple muscle shapes for the skeleton. To make the muscle, you'll first specify the Attach objects. These are the parts of the skeleton where each end of the muscle will be attached. Once you create the muscle, you can edit its shape using the controls in the Muscle Builder interface.

  3. In the Outliner, Shift+click the plus sign next to L_ArmJoints to expand the L_ArmJoints group. Select the L_shoulder object.

  4. In the Muscle Builder window, click the button labeled <<< to the right of the Attach Obj 1 field. This loads the L_shoulder capsule into this field.

  5. In the Outliner, select the L_elbow capsule and load it into the Attach Obj 2 field (see Figure 7.51).

    Specify the two Attach objects in the Muscle Builder window.

    Figure 7.51. Specify the two Attach objects in the Muscle Builder window.

    The nSpans, nSegs, Width, and Falloff sliders determine the shape of the muscle's surface. The default settings should work fine for this demo. Usually you'll want to set these before creating the muscle surface. NSpans and nSegs determine the number of spans and segments that the NURBS muscle surface will use. Falloff determines how the ends of the muscle taper at each end; a lower setting creates less of a taper. Width determines the overall width of the muscle shape.

  6. Click the Build/Update button to create the muscle.

    The Muscle object appears in the perspective view attached to the skeleton, as shown in Figure 7.52. You'll see that a new NURBS surface named cMuscleBuilder_surf1 has been created along with two new cameras named MuscleBuilderCamera and MuscleBuilderCameraSide. The cameras are used in the Muscle Builder interface.

  7. Save the scene as leftArmMuscle_v01.ma. To see a version of the scene, open the leftArmMuscle_v01.ma scene from the chapter7scenes directory on the DVD.

The muscle surface appears attached to the skeleton.

Figure 7.52. The muscle surface appears attached to the skeleton.

Edit a Muscle Using Muscle Builder

The settings in the Muscle Builder can be used to edit the placement and the shape of the muscle.

  1. Continue with the scene from the previous section or open the leftArmMuscle_v01.ma scene from the chapter7scenes directory on the DVD.

    To properly place the bicep you should check an anatomy reference. Some experimentation is required to place the muscle and achieve realistic motion and deformation. The settings applied to the muscle may look exaggerated in Maya, but this may be necessary to create a realistic deformation. In this section you'll learn how to use the controls in the Muscle Builder interface to place the muscle.

  2. In the Display Layer menu, set the display mode of the armMesh layer to Template so you can see the arm mesh while working on placing the bicep.

  3. If the Muscle Builder is not already open, select the cMuscleBuilder_surf1 object and choose Muscle

    Muscle Surface Name
  4. Use the Move tool to place the Attach Obj 1 locator in front of the L_shoulder joint. Try to use the shape of the leftArmMesh geometry as a guide.

    The sliders labels At, Off. X, and Off. Z in the Muscle Builder interface can be used to numerically position the attach points. The At slider is used to position the Y axis of the muscle attach point.

  5. Click the Attach Obj 2 button to place the other end of the muscle. The bicep muscle attaches to the lower part of the arm just beyond the elbow (see Figure 7.53).

  6. Switch to the Cross Section tab. In this section of the interface, the curves that control the shape of the muscle surface are listed on the left. Two camera views allow you to select the curves and move them to shape the overall muscle. To edit the position of one of the circles, select one of the curves listed on the left and then use the Move tool to reposition the curve. Movements of each control circle are limited to the X and Y axes.

    You can move the circles in the perspective view as well as in the cross-section view of the Muscle Builder interface (see Figure 7.54).

    Position the attach points at either end of the muscle using the Move tool and the sliders in the Muscle Builder interface.

    Figure 7.53. Position the attach points at either end of the muscle using the Move tool and the sliders in the Muscle Builder interface.

    You can use the cross-section views to edit the shape of the muscle.

    Figure 7.54. You can use the cross-section views to edit the shape of the muscle.

  7. Right-click on one of the curves in the top cross-section view of the Muscle Builder interface, and choose Control Vertex. Use the Move tool to further customize the shape of the muscle by moving the CVs of the circles.

  8. Save the scene as leftArmMuscle_v02.ma. To see a version of the scene to this point, open the leftArmMuscle_v02.ma scene from the chapter7scenes directory on the DVD.

Finalize the Muscle

When you have finished editing the basic shape of the muscle, you are ready to convert it to a muscle deformer. This action is performed in the Finalize tab of the Muscle Builder window.

  1. Continue with the scene from the previous section or open the leftArmMuscle_v02.ma scene from the chapter7scenes folder on the DVD.

  2. In the Outliner, select the cMuscleBuilder_surf1 object, and open the Muscle Builder window (Muscle

    Finalize the Muscle

    The Finalize tab converts the surface into a muscle deformer—you have a choice between Muscle Spline Deformer and Muscle Stretch. Muscle Spline Deformer is the preferred option when creating a muscle because it has more controls and is therefore more useful than the Muscle Stretch option.

  3. Leave Num Controls set to 3 and Type set to Cube (you can choose Curve or Null as well, whichever you prefer).

    If you need to mirror the muscle to the opposite side of the body, you can choose a mirror axis from the Create Mirror Muscle options. You can use the Search and Replace fields to replace prefixes such as L (for left) with R (for right) on the mirrored objects.

  4. Click the Convert To Muscle button to create the deformer. In the pop-up box, you will be warned that further changes cannot be made to the muscle using the interface controls. You'll also be prompted to name the muscle. Name it L_bicep (see Figure 7.55).

When you finalize the muscle, the original surface is grouped with its controls. Control cubes appear at either end of the muscle and in the center. These can be used to fix position and rotation problems. At this point you do not want to close the Muscle Builder window. You can test and edit settings using the controls in the Muscle Parameters tab.

You are prompted to name the muscle when you click the Convert To Muscle button.

Figure 7.55. You are prompted to name the muscle when you click the Convert To Muscle button.

Edit Muscle Parameters

Muscle parameters determine how the muscle behaves as the joints are animated. If you select the L_arm_CTRL locator and move it around, you'll see that the muscle actually stretches and squashes.

Many of the settings in the Muscle Object Settings section can be changed in the Channel Box or Attribute Editor as well. Some of the settings, such as nSegs and nSides, apply only to the display of capsules. For this section, you'll be mostly concerned with settings related to Squash and Stretch.

  1. In the Muscle Object Settings section, set Draw to Muscle. If this is set to Off, you'll see the deformer, but changes made to the Squash and Stretch settings will not be displayed.

    The first step toward editing the muscle's behavior is to establish its default stretch and squash shapes based on the movement of the arm.

  2. Currently the arm is slightly bent. You can use this pose to establish the relaxed, default shape of the bicep muscle. In the Spline Length Settings section, click the Set Current As Default button.

  3. In the perspective view, select the L_arm_CTRL locator and pull it along the X axis to straighten the arm. This stretches the L_bicep muscle to its extreme pose. Click the Set Current As Stretch button.

  4. Push the L_arm_CTRL locator toward the chest so the arm becomes completely folded. Click the Set Current As Squash button (see Figure 7.56).

  5. In the Outliner, expand the grpMUSCLES group and the grpL_bicepRIG. Select the cMuscleSplineL_bicep node.

    The settings in the Stretch Volume Presets section determine how the shape muscle deformer transitions between extreme poses. To set this properly, animate the arm so you can adjust the settings and see the results as the arm moves.

  6. Set the Time slider to 100 frames. Select the L_arm_CTRL locator, and create a short animation where the locator moves back and forth, causing the arm to bend and straighten.

  7. Play the animation, and make sure the Muscle Builder window is still open. Make sure the cMuscleSplineL_bicep node is selected in the Outliner. As the arm moves, you may see some jiggling in the muscle; that's part of the Jiggle settings, which we'll edit in the next few steps.

  8. As the arm moves back and forth, click the Small, Medium, and Large buttons. Notice the change in the muscle's size and behavior as you switch between presets.

  9. You can edit the numeric values in the START, MID, and END fields to fine-tune the behavior. It's usually easiest to start by loading one of the presets and then make small changes to the values.

    When you're happy with how the muscle is shaped as it moves, you can move on to editing the Jiggle motion.

  10. While the animation plays, click the Default, Light, Medium, Heavy, and OFF buttons in the Jiggle Presets section. Observe the difference in behavior as each preset is applied.

  11. You can fine-tune the behavior of the jiggling by editing the numeric values in the START, MID, and END fields for Jiggle, Cycle, and Rest. Jiggle is the intensity of jiggle, Cycle is the frequency of jiggle oscillation, and Rest is the time it takes for the muscle to come to a stop. The Dampen settings add a damping effect as the muscle reaches extreme poses.

  12. Save the scene as leftArmMuscle_v03.ma. To see a version of the scene to this point, open the leftArmMuscle_v03.ma scene from the chapter7scenes directory on the DVD.

Establish the Squash position for the L_bicep muscle.

Figure 7.56. Establish the Squash position for the L_bicep muscle.

Convert the Smooth Skin to a Muscle System

Now that the muscle has been set up and is working properly, you can apply it to the arm geometry so it deforms the character's skin. Applying the deformer to the geometry involves weighting the skin to the muscles. This is very similar in concept to smooth binding geometry to Maya's joints. In fact you can actually convert the skin weights painted earlier in the chapter to the muscle system.

  1. Continue with the scene from the previous section or open the leftArmMuscle_v03.ma scene from the chapter7scenes directory on the DVD.

  2. Select the L_arm_CTRL locator and delete the keyframes. Set the Translation Channels to 0.

  3. In the Layer Editor, set the Display mode of the armMesh to Normal (not Template or Reference).

  4. In the Outliner, select leftArmMesh. Choose Muscle

    Convert the Smooth Skin to a Muscle System
  5. Maya asks you to choose the axis for the capsules. Choose the X-axis to match the orientation of the capsules. Converting the skin takes a few moments; you'll see a dialog box that displays the progress of the calculation.

    This takes the smooth skin joint weights that were painted on the geometry and converts them to muscle weights. However, only the capsules in the L_armJoints hierarchy are included. If you move the L_arm_locator, you'll notice that the muscle does not yet deform the skin. It needs to be attached to the skin and weighted before it will work.

  6. Select the L_bicep surface (in the Outliner expand the grpMUSCLES/grpL_bicepRIG/grpL_bicepGEO hierarchy and select the L_bicep surface, or select the surface directly in the viewport window) and Ctrl+click the leftArmMesh object. Choose Muscle

    Convert the Smooth Skin to a Muscle System
    Connect the L_bicep surface to the leftArmMesh geometry as a muscle deformer.

    Figure 7.57. Connect the L_bicep surface to the leftArmMesh geometry as a muscle deformer.

  7. A dialog box asks you to set the Sticky Bind Maximum Distance. Choose Auto-Calculate.

    The L_bicep surface is now connected to the skin geometry. However, it still will not affect the geometry until the weights are painted for L_bicep.

  8. Switch to shaded view. Select leftArmMesh and choose Muscle

    Connect the L_bicep surface to the leftArmMesh geometry as a muscle deformer.
  9. Scroll to the bottom of the list in the Muscle Paint window and select L_bicep. The geometry turns black, indicating there is no weight for this muscle.

  10. Set Weight to 0.1 and Operation to Add. Paint over the area of the bicep to start adding weights. Low-weight values are blue, and higher-weight values are green, orange, and red.

  11. Use the L_arm_CTRL locator to pose the arm as you paint weight values for the bicep (see Figure 7.58).

    Paint weight values for the L_bicep muscle.

    Figure 7.58. Paint weight values for the L_bicep muscle.

  12. When you have finished painting the weights, close the window. Create another animation for the L_arm_CTRL locator so you can see the muscle in action as it deforms the skin.

  13. If you need to change muscle parameters such as the Jiggle attributes, select the cMuscleSplineL_bicep node and choose Muscle

    Paint weight values for the L_bicep muscle.
  14. Save the scene as leftArmMuscle_v04.ma. To see a version of the scene, open the leftArmMuscle_v04.ma scene from the chapter7scenes directory on the DVD.

Sliding Weights

Sliding weights are used to create the effect of bones sliding beneath the skin. In this example, you'll create a very simple elbow object that slides beneath the skin of the arm as the arm bends.

  1. Continue with the scene from the previous section or open the leftArmMuscle_v04.ma scene from the chapter7scenes directory on the DVD.

  2. Create a polygon sphere object and name it elbowBone.

  3. Position elbowBone at the end of the elbow in the arm; allow the elbowBone to protrude from the skin slightly. Scale elbowBone to 1, 0.5, and 0.5 in X, Y, and Z. See Figure 7.59.

  4. Freeze transformations on the elbowBone. Select L_elbow joint and Ctrl+click elbowBone. Choose Constrain

    Sliding Weights
  5. Select elbowBone and choose Muscle

    Sliding Weights
    Place the elbow-Bone object at the arm's elbow and scale it.

    Figure 7.59. Place the elbow-Bone object at the arm's elbow and scale it.

  6. Select elbowBone and Ctrl+click the leftArmMesh. Choose Muscle

    Place the elbow-Bone object at the arm's elbow and scale it.
  7. Select leftArmMesh. In the Channel Box, select the cMuscleSystem1 node under INPUTS. Set Enable Sliding to On. This is an easy step to forget, but if you don't enable sliding weights on the character's skin, you won't see the sliding effect as the bone moves (see Figure 7.60).

    Enable sliding weights for the leftArmMesh.

    Figure 7.60. Enable sliding weights for the leftArmMesh.

  8. Select leftArmMesh and choose Muscle

    Enable sliding weights for the leftArmMesh.
  9. Paint a large area around the elbow. This does not have to be precise; you just need to cover the area the elbowBone will affect as it moves beneath the skin (see Figure 7.61).

    Paint sliding weights in the elbow area of the arm geometry.

    Figure 7.61. Paint sliding weights in the elbow area of the arm geometry.

  10. Close the Paint Weights window and play the animation. You can see that the geometry around the elbow is affected and the elbowBone object moves. It may be more obvious if you increase the resolution of the skin.

  11. Select the leftArmMesh object. From the Polygon menu set, choose Mesh

    Paint sliding weights in the elbow area of the arm geometry.
  12. Select the elbowBone object. In the Channel Box, select the cMuscleObject_elbowBoneShape1 node, and set Fat to 0.2. This adds an offset to the deformation caused by the elbowBone shape.

    The elbow object may penetrate the skin, but that's okay; you can disable its visibility so it does not appear in the render.

  13. Play the animation and continue to make adjustments to the weighting of the elbowBone. Try adding a small amount of sticky weighting for the elbowBone (switch the Weight menu to Sticky in the Paint Weights window).

  14. Select the leftArmMesh object and open its Channel Box. Under the cMuscleSystem1 node, you'll find additional settings to adjust the quality of sliding weights.

    The Shrink Wrap feature helps when the bone has detail that you want to be visible in the character's skin. The skin should be dense enough to allow the detail to be visible.

    There is still a ways to go before the arm deforms in a believable fashion. More muscles and bones can be added, and the weighting can be fine-tuned for each muscle to improve the deformations created by the muscle system. Setting up an entire character is even more work. It is no wonder why there are many artists who specialize in rigging. It's a difficult art to master, and it takes time, study, and practice.

  15. Save the scene as leftArmMuscle_v05.ma. To see a version of the scene to this point, open the leftArmMuscle_v05.ma scene from the chapter7scenes directory on the DVD.

The Bottom Line

Understand rigging

A rig is a system of controls and deformers used to make the process of animating easier. Joints are the most common deformers used to create a character animation rig. Joints are bound directly to geometry or indirectly by skinning another deformer, such as a lattice, to the joints.

Master it

Create a rig using three bones and a lattice around a simple piece of geometry such as a sphere. Use the bones to animate the lattice.

Create and organize joint hierarchies

A joint hierarchy is a series of joint chains. Each joint in a chain is parented to another joint, back to the root of the chain. Each joint inherits the motion of its parent joint. Organizing the joint chains is accomplished through naming and labeling the joints. Proper orientation of the joints is essential for the joints to work properly.

Master it

Create a joint hierarchy for a humanoid character. Label the joints and create names based on the labels. Orient the joints so the X axis points down the length of the joints.

Use Inverse Kinematics rigs

A joint chain that uses Inverse Kinematics uses a goal called an End Effector to orient the joints in the chain. There are a number of solvers available in Maya, some of which need to be loaded into Maya using the command line.

Master it

Create an Inverse Kinematic rig for a character's leg. Use a separate control to position the knee of the character.

Apply skin geometry

Skinning geometry refers to the process in which geometry is bound to joints so that it deforms as the joints are moved and rotated. Each vertex of the geometry receives a certain amount of influence from the joints in the hierarchy. This can be controlled by painting the weights of the geometry on the skin.

Master it

Paint weights on the hand model so that the padding of the thumb bulges when the thumb is rotated toward the palm of the hand.

Use Maya Muscle

Maya Muscle is a series of tools designed to create more believable deformations and movement for objects skinned to joints. Capsules are used to replace Maya joints. Bones are deformers created from geometry, and muscles are NURBS surfaces that squash, stretch, and jiggle as they deform geometry.

Master it

Use Maya Muscle to create muscles for the forearm. Use the muscle system to reduce the amount of shrinking that occurs in the arm geometry when the forearm is rotated around its axis.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset