• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL

Chapter 4. Deforming the Skin > Deforming the Skin with Muscles

Deforming the Skin with Muscles

So far you have been mainly working with skeletal deformers, which enable you to animate all the main parts of your character’s body. You can, however, make your character more realistic by adding secondary muscle flexing. There are a couple of ways to do this in Maya. One way is to add muscle skeletons that have their transforms driven to produce flexing, and the other way is to use geometry-based muscle objects that can actually change shape to produce flexing. In both cases, you set driven keys to drive the muscles, which in turn deform the skin.

Creating Muscle Skeletons

The simplest way to add muscle flexing to your character is to create muscle skeletons parented under the main skeletal joints and assign them with your other joints when you bind. When the muscle skeletons are parented correctly, you can set driven keys to drive them automatically when the joints rotate. In addition, you can create custom channels that enable you to drive the muscle joints manually.

Adding muscle skeletons to your current rig is not very different from how you added skeletons in the preceding section to make your bind more specific. The only difference is that a muscle skeleton must be animated, so it should be drawn according to how the muscle flexes. Most of the time, a convenient way to do this is to draw the joint so the X-axis points in the flexing direction. You can then drive the scaling in X of the muscle joint to produce the desired result (see Figure 4.23).

4.23. Draw muscle joints in the direction that the muscle should flex, and then drive its scaling in X.

To create some muscle skeletons in the upper arm, for instance, you would draw several two-joint skeletons in the biceps and triceps areas. From the previous skeleton, you may already have drawn an elbow skeleton to stabilize and better articulate the elbow. The muscle skeletons should radiate outward from the upper-arm bone. In a simple character, a single skeleton for the biceps and a single skeleton for the triceps are sufficient. If you have a more realistic character, however, draw multiple skeletons for each muscle so that you can have more control over the shape of the deformations on the arm skin.

It is important that all the muscle skeletons are parented under the correct skeletal joints. Both biceps and triceps skeletons should be child to the appropriate upper-arm joint. Create two group nodes between the skeletons to keep extra bones from being drawn. Then move your arm character controls around to make sure all the muscle skeletons move correctly with the arm. When everything is parented, drive the transforms of the muscle skeletons with the Z rotation of the lower-arm joint. On the left arm, for instance, load the LtArmLow joint as the driver, and the X scaling of the biceps muscle joint as the driven. Set driven keys on the biceps joint when the lower-arm joint is in its fully extended position and fully rotated position. If you have multiple biceps joints, you can load them all in at the same time, and drive their X scaling together. Keep in mind that you may also have to drive other transform channels on the muscle joints to get the desired skin deformation. Set similar keys to drive the triceps-muscle skeletons but making the triceps flex when the arm rotates in the opposite direction.

The reason it is best to use driven keys to control muscle skeletons is so that you can use multiple drivers. On the upper arm, for instance, you can also drive the muscle skeletons when the arm turn joint rotates in X. In a real arm, this action automatically changes the shape of the biceps muscle, because the radius bone stretches it when the forearm rotates. To change the shape of the biceps, you must do more than just control the scaling in X of a single biceps skeleton. Instead, you must drive multiple biceps skeletons that are assigned to each part of the skin’s biceps area (see Figure 4.24). Finally, you can create muscle channels to manually drive the flexing of each muscle skeleton. This is meant to simulate the last level of muscle contraction, so the skeletons should be transformed so that the skin is in its most extreme deformation. Place the manual muscle channels either on your existing icon controls, or create additional muscle icons to place them on. Make the new muscle icons child to the main skeletal icons.

4.24. To better deform the shape of the skin, try adding multiple joints for a single muscle area, such as in a biceps.

Using Influence Objects for Muscle Deformation

Another way to create muscle deformations is to add influence objects to your rig. You can create an influence object from NURBS surfaces, polygon surfaces, curves, and locators. Influence objects can be added only to a surface that has already been bound as a smooth skin. Actually, even if you want to add more skeletons to your previous bind, you do it by adding them as influence objects. The new influences are added to the list of deformers on the skinCluster node, and their weights can then be painted or adjusted in the Component Editor.

It is relatively easy to assign influence objects. Just select the skin that you want to add a new deformer to, Shift-select the influence object, and choose Skin, Edit Smooth Skin, Add Influence . In the resulting options box, choose to Use Geometry if your influence object is a surface or curve. If you are adding a skeleton or locator, it is not necessary to turn on the Use Geometry option. This option bases the weight assignment on the shape of the influence object’s point structure (see Figure 4.25). For instance, a U-shaped influence curve would have points on the skin weighted to it in the same U shape. If you don’t turn on this option, the weighting is assigned to fall off from the center of the influence object, and ignore its component shape.

4.25. Turning on the Use Geometry option assigns the weighting of the skin to reflect the shape of the influence object.

The Dropoff option for muscle influences should be set to a high value, because you want the muscle to affect only the area of the skin directly around it. You can increase the Polygon Smoothness and NURBS Samples options to make the influence object deform the skin more accurately. However, these settings should only be increased if necessary, because they can considerably slow down your computer system. If you are adding an influence object before manually adjusting weights on your character’s skin, you should leave the Weight Locking option turned off. Maya recalculates the weights in the area of the influence object according to the drop-off setting. If you have spent time adjusting weights, turn the Weight Locking option on, and set the Default Weight value to 0. This prevents Maya from assigning any weighting to the influence object. You can then manually add weighting to the influence object using the Paint Skin Weights tool or Component Editor, while placing holds on weights that should not be changed through normalizing of the weights. When all the settings are correct, click the Add button.

One thing that you should be aware of when adding influence objects is that your character must be in its bind pose to add an influence object successfully. The bind pose is the position your skeletons were in when you first did a smooth bind on the skin. If you test your bind by moving your character controls, and do not click Undo to get back to the bind pose, you will get an error message when you try to add an influence object. On a simple skeleton, getting back to the bind pose is relatively easy. Just select the skeleton and choose Skin, Go to Bind Pose. On a complicated rig, however, channel constraints such as expressions can prevent this command from working. As mentioned previously, a good way to ensure that you can get back to your character’s default pose is to set keys at frame 0 on all your character controls before you bind. This enables you to get back to the bind pose by setting the timeline back to 0. If you cannot get the character back into its bind pose, you receive an error message when you try to add an influence object.

When prevented from getting back to the bind pose, you can do one other thing. First, select a bound skeleton, and in the hypergraph view, turn on Input and Output Connections to graph all the nodes. Then find the bind pose node and delete it (see Figure 4.26). This should enable you to add influence objects, and Maya generates a new bind pose node after the influence is added. If for some reason you still can’t add influences, it may be necessary to delete your current bind and rebind your character. If you have done a lot of work manually adjusting weights, use the Export Skin Weights command to save your skin weights, and import them again after rebinding.

4.26. Delete the bind pose node if you get an error message when trying to add influence objects to your skin.

You can drive the transforms of muscle influence objects in the same way as driving the transforms of muscle skeletons. First, make sure all the influence objects are child to the appropriate skeletal joints. Then drive the transforms of the influence objects with the rotation of the skeletal joints. When driving the transforms, you may need to adjust the position of the pivot points on the influence objects. In the arm, for instance, you can use influence objects rather than skeletons to simulate biceps and triceps muscle flexing. Simple spheres can be scaled to fit inside the appropriate muscle areas. However, you should place their pivot points toward the center of the upper-arm bone so that the influence objects scale correctly in relation to the arm (see Figure 4.27).

4.27. Make sure you place the muscle influence pivot points in the correct place for driving muscle flexing on the skin.

If you are going to just drive the transforms of muscle influences, you don’t need to use a surface or curve as an influence object. Using a skeleton or locator works just as well, and does not use as much of your computer system’s resources. Just make sure not to turn on the Use Geometry option when adding the influences. The main reason to use a surface or curve as an influence object is to use the components of the influence object to drive the shape of the muscle deformation on the skin. Components can be driven on an object by selecting them in component mode, and by setting driven keys for their positions when a skeletal joint rotates. To drive the shape of a biceps sphere, for instance, switch to component mode and select all the points on the sphere. Then load the points into the Driven section of the Set Driven Key options box, and load the lower-arm joint’s Z rotation into the driver section. Hold down the Shift key to select the X, Y, and Z positions of the biceps sphere’s points, and set a key for their default position (see Figure 4.28). Then rotate the arm joint into a fully bent pose, move the points on the biceps sphere, and set another key.

4.28. You can drive the shape of a muscle influence object by loading its components into the Set Driven Key options box.

After setting some driven keys on the points of the biceps influence object, you should see it change shape when the arm rotates. However, you will not see the effect of the deforming muscle object on the skin yet. To have the components of an influence object actually affect the skin, you must turn on a channel for the skinCluster node of the skin, which is by default always turned off. If you select the arm skin, and click the skinCluster node in the Inputs section of the channel bar, you will see a useComponents channel. Type a 1 into this channel to turn it on (see Figure 4.29). After the channel is turned on, you should see the points of the biceps influence object deform the skin when the arm bends. Keep in mind that, on a character with multiple skin surfaces, this needs to be done to every skin that will be affected by a deforming muscle influence.

4.29. In the useComponents channel of the skinCluster node, type a 1 to turn it on, and enable the components of a muscle influence object to deform the skin.

Muscle influence objects can be added in every part of your character’s body. Using NURBS or polygon surfaces rather than curves requires that you hide the muscle surfaces when rendering your animation. Do this by placing all the muscle influence objects on a separate layer named Muscles that can then be easily hidden. But to make sure your muscle influence objects never accidentally show up in your renders, always use curves rather than surfaces. Also keep in mind that deforming the skin with the components of influence objects requires much more computer resources than deforming the skin with muscle joints. If your computer system has limited resources, you should instead use joints for muscle deformations.

Exercise 4.3: Adding Muscle Influences

In this exercise, you add muscle skeletons and muscle influence objects to your bind.

First, you need to choose what kind of influence to add based on the design of your character, and your computer system’s resources. Keep in mind that using geometry-based influence objects requires more system resources than using skeleton influences. One approach is to use both kinds based on the amount of detail required. Draw each skeleton or place each influence object so that it fits right inside the skin. After creating each influence, make sure you also parent it to the appropriate main skeletal joint.

Add each influence to your bind by selecting the skin, Shift-select the influence, and choose Skin, Edit Smooth Skin, Add Influence . Turn on the Use Geometry option only if you are adding a surface or curve as an influence object. Set the Dropoff option relatively high, so the influence affects only the skin around the muscle, and leave the Polygon Smoothness and NURBS samples at their default settings. If you have spent time painting weights, turn on the Weight Locking option, and set it to 0. This assigns the influence with no weighting, which enables you to carefully add the weight manually. Otherwise, Maya assigns the weighting, which can change your previous weight settings. Once added, you can manually add the weighting by painting weights or using the Component Editor.

Finally, set driven keys on the transforms of all muscle skeletons to make them automatically flex when the appropriate skeletal joints rotate. Use a similar method to drive the components on muscle influence objects. Switch to component mode to select their points, and load them into the Set Driven Key options box. Shift-select all their positions, and set driven keys on them. Remember that you can also create custom channels on your icon controls to manually drive the muscle influences as needed. ▪

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint