Chapter 6. Animating with Deformers

Deformers can be used for both modeling and animation and as part of an animation rig. In this chapter, you'll see some of the ways to animate geometry using deformers. From creating facial expressions to animating a jellyfish, there are thousands of ways you can apply deformers to bring your creations to life.

In this chapter you will learn to:

  • Animate facial expressions

  • Create Blend Shape sequences

  • Use lattices

  • Animate clusters

  • Animate nonlinear deformers

  • Use jiggle deformers

  • Use the geometry cache

Animate Facial Expressions

Animating facial expressions for characters is usually accomplished through the use of Blend Shapes. While this is not the only way to animate expressions and speech, it is the most common because it is relatively straightforward to set up and animate. In this section, you'll learn how to create Blend Shape targets, paint Blend Shape weights, create a Blend Shape deformer, and build a simple facial animation rig.

A Blend Shape deformer uses one or more Blend Shape targets. These targets are duplicates of the original model that have been modified using a variety of modeling techniques. The Blend Shape deformer is created by selecting the targets and the original model and choosing Create Deformers

Animate Facial Expressions

There are a few things you should understand about how Blend Shapes work before you set up a facial animation rig.

First of all, Blend Shapes always move in a straight line when interpolating the change between the original model and the Blend Shape target. Think of how your eyelids move when you blink. Your eyelid is a flap of skin that moves over the spherical shape of your eyeball. If you make a dot on the edge of your eyelid with a marker (don't do this, just imagine it) and then follow the path of that dot from a side view, the dot moves in an arc as your eyelid closes.

If you have a model of a face with the eyes open and a Blend Shape target with the eyes closed, when you create the Blend Shape deformer and then animate the eyes closing, instead of moving in an arc, the eyelids will move in a straight line from the open position to the closed position. Most likely the eyelid geometry will pass through the eyeball geometry, creating a less-than-convincing blinking behavior (see Figure 6.1). Understanding that the Blend Shapes deformer moves in a linear direction from one state to the next is important if you are to develop a solution for this problem.

Blend Shape deformations move in a straight line, which can cause problems for certain types of facial movements, such as blinking eyelids.

Figure 6.1. Blend Shape deformations move in a straight line, which can cause problems for certain types of facial movements, such as blinking eyelids.

Second, a Blend Shape target should have the same number of vertices and the same point order as the original geometry. Vertices on polygons and CVs on NURBS geometry are numbered in a specific order. You can see the numbers listed in the Script Editor when the vertices are selected. If the number of points and the order of the points on a Blend Shape target do not match the original, the deformer will not be created or it will behave strangely (see Figure 6.2). It is possible to use a Blend Shape target that has a different number of vertices than the base mesh; however, this can lead to some unpredictable results.

Third, when deforming a model with more than one Blend Shape target, the changes created by the targets are added together. So if you have one Blend Shape target in which a face is smiling and a second target in which the face is frowning, you may think that one target cancels out the other. In fact, setting both Blend Shape targets to Full Strength creates a strange result on the base mesh because the smile and the frown will be added together (see Figure 6.3).

When the point order of the base mesh and the Blend Shape target do not match, strange results can occur when the deformer is applied.

Figure 6.2. When the point order of the base mesh and the Blend Shape target do not match, strange results can occur when the deformer is applied.

A smile shape and a frown shape are added together to create a very strange expression.

Figure 6.3. A smile shape and a frown shape are added together to create a very strange expression.

Blend Shape Targets

The first step in setting up a Blend Shape facial animation rig is to model the actual Blend Shapes based on the base mesh. The final rig works something like the controls for a puppet. Rather than animate a happy face model and a sad face model, you really want to isolate individual muscle movements. This will give you the most control when animating. When animating a smile, you'll have controls for the mouth, eyelids, eyebrows, cheeks, and more, so you have the option of animating a smile with brows up for a happy character and a smile with brows down for a menacing character. In addition, you want to isolate the sides of the face so the corner of one side of the mouth can be animated separately from the corner of the other side of the mouth.

When creating Blend Shape targets, it's best to think in terms of what the muscle is doing rather than a particular expression. The same targets are used to animate speech and emotion. So rather than creating a Blend Shape target for a smile and a Blend Shape target for the "eeeee" sound, you want to make a single Blend Shape target that pulls a corner of the mouth back. Then this Blend Shape target combined with muscle movements created for other targets can be used for smiling, saying "cheeeese," or both at the same time.

In this exercise, you'll create Blend Shape targets for a character's mouth that can be used for widening the lips as in a smile and narrowing the lips as in a kiss. These two shapes (mouthWide and mouthNarrow) will then be separated into four shapes (leftMouthWide, leftMouthNarrow, rightMouthWide, and rightMouthNarrow).

  1. Open the nancy_v01.ma scene from the chapter6scenes directory on the DVD. This scene shows a very basic polygon head. Simple shapes for the eyes, tongue, teeth, and hair are included.

    It's a good idea to have these parts of the model included, even if they are just temporary versions. It makes modeling the shape changes easier. Teeth play a big role in the way the mouth is shaped when moving, so it's good to have some kind of guide available while making Blend Shape targets. A simple hair shape is useful as a visual indicator for the hairline starts when working on shapes for the brow.

  2. Select the nancy model and duplicate it (Ctrl+d). Move the duplicate to the side, as shown in Figure 6.4. Name the duplicate mouthWide.

    A duplicate of the original head model is created.

    Figure 6.4. A duplicate of the original head model is created.

    By default, Blend Shape deformers calculate only shape node–level changes. In other words, only changes made on the vertex level are considered. You can move, rotate, and scale the targets without affecting the base mesh—unless you specify otherwise in the Deformer options (this will be discussed further later on).

  3. Select the Move tool and open the Options box for the tool. Under the Reflection Settings, activate Reflection, and set Reflection Axis to X.

  4. Turn on Soft Select, and set Falloff Mode to Surface. Set Falloff Radius to 0.80 and add a point to the Falloff Curve. Adjust the curve to look like Figure 6.5. You'll be changing these options a lot, so keep the Move Tool window open while you work.

    The options for the Move tool

    Figure 6.5. The options for the Move tool

  5. Right-click on the mouthWide geometry, and choose Vertex to switch to vertex selection mode.

  6. Select a vertex at the corner of the mouth, as shown in Figure 6.6. You'll see the vertices colored, indicating the Soft Selection radius and falloff. Carefully start moving the corner to the side and back toward the ear.

    The muscles in the face work in concert to create facial expressions. Most of the face muscles are designed to convey emotion, aid with speech, and keep food in your mouth while you eat. Muscles work in groups to pull parts of the face in various directions like a system of pulleys. When you smile or grimace, the corners of your mouth are pulled back toward the ears by several muscles working together.

    The vertices are color coded to indicate the falloff strength and radius of the Move tool when Soft Selection is enabled.

    Figure 6.6. The vertices are color coded to indicate the falloff strength and radius of the Move tool when Soft Selection is enabled.

    Cartoons often simplify the smile by drawing the corners of the mouth upward into a U shape. However, in reality the corners of the mouth actually move upward only a very small degree. The illusion of perspective makes it look as though the mouth is forming a U. The smile shape is not really a U shape, but rather the lips are stretched in a nearly a straight line across the teeth.

  7. It will take a little work to form the smile shape on the face. Use a mirror for reference. Keep in mind that as the lips are pulled across the teeth, they are stretched and lose volume, giving them a thinner appearance (see Figure 6.7).

    As you work, make adjustments to the settings on the Move tool, and change the Falloff Radius and Falloff Curve values as needed.

  8. When the corners of the mouth are pulled back, adjust other parts of the face near the corners and on the lips, but don't go too far beyond the area of the mouth. Remember, you are making an isolated change in the shape of the mouth, not a complete facial expression.

    In addition to the Move tool, the Artisan Brush is very useful for sculpting changes in the model. To activate this tool, select the mouthWide model, and choose (from the Polygon menu set) Mesh

    The vertices are color coded to indicate the falloff strength and radius of the Move tool when Soft Selection is enabled.
    Moving left to right, these images show some of the steps involved in creating a smile using the Move tool and the Artisan Brush tool.

    Figure 6.7. Moving left to right, these images show some of the steps involved in creating a smile using the Move tool and the Artisan Brush tool.

    The final wide mouth shape should look like a fake smile because there are no changes in the other parts of the face. I tend to build a little overshoot into my Blend Shape targets so I have wider range to work with when animating (see Figure 6.8).

    The base model (left) and the completed smile Blend Shape target (right)

    Figure 6.8. The base model (left) and the completed smile Blend Shape target (right)

  9. Save the scene as nancy_v02.ma.

  10. Create another duplicate of the nancy model. Name the duplicate mouthNarrow. Move it to the model's right side. You may want to move the teeth with the model so you can use them as a guide.

  11. Use the Move tool and the Artisan Brush to push the sides of the mouth toward the center of the face. The lips should bulge up in the center.

    As the lips push together and bulge at the center, there is a slight curling outward. Those parts of the upper and lower lips that touch in the neutral pose become exposed and the flesh of the lips rolls outward (but just very slightly). You can use the Rotate tool to help create this rolling outward effect (see Figure 6.9). Figure 6.10 shows the finished narrow mouth Blend Shape target, the base mesh, and the smile Blend Shape target, respectively.

    Moving left to right, the images show some of the steps involved in shaping the narrow lips using the Move tool, the Rotate tool, and the Artisan Brush tool.

    Figure 6.9. Moving left to right, the images show some of the steps involved in shaping the narrow lips using the Move tool, the Rotate tool, and the Artisan Brush tool.

    The completed narrow mouth Blend Shape target is on the left of the base mesh and smile Blend Shape targets.

    Figure 6.10. The completed narrow mouth Blend Shape target is on the left of the base mesh and smile Blend Shape targets.

  12. Once you are satisfied with the two mouth shapes, save the scene as nancy_v02.ma. To see a version of the scene up to this point, open the nancy_v02.ma scene from the chapter6scenes folder on the DVD.

Create Blend Shapes

To create the Blend Shape deformer, select all of the targets first and then the base mesh. Next choose the Blend Shape deformer from the Deformers menu in the Animation menu set. In this section you'll create the deformer using the mouthWide and mouthNarrow shapes.

  1. Continue with the scene from the previous section or open the nancy_v02.ma scene from the chapter6scenes folder on the DVD.

  2. Shift+click the mouthWide model and the mouthNarrow model; then Shift+click the nancy model.

  3. Switch to the Animation menu set, and choose Create Deformers

    Create Blend Shapes
  4. Name the Blend Shape deformer nancyFace (see Figure 6.11). Click Create to make the deformer.

  5. To test the deformer, choose Window

    Create Blend Shapes
  6. Move the sliders up and down, and see how they affect the model (see Figure 6.12). Try putting both sliders at 1 to see the shapes added together. Try setting the values to negative values or values beyond 1.

  7. Save the scene as nancy_v03.ma. To see a version of the scene to this point, open the nancy_v03.ma scene from the chapter6scenes directory on the DVD.

The options for the Blend Shape deformer

Figure 6.11. The options for the Blend Shape deformer

The Blend Shapes are controlled using the Blend Shape sliders.

Figure 6.12. The Blend Shapes are controlled using the Blend Shape sliders.

Paint Blend Shape Weights

At this point you have two Blend Shapes available for animating, mouthWide and mouthNarrow. You may decide you want additional Blend Shape targets for the same mouth shape but restricted to just one side of the mouth. This gives you more options for animating a wider variety of facial movement. One easy way to create these additional targets is to use Blend Shape weighting as a shortcut for making additional Blend Shape target models from the symmetrical facial poses you've already created.

  1. Continue with the scene from the previous section or open the nancy_v03.ma scene from the chapter6scenes directory on the DVD.

  2. Select the nancy model, and choose Edit Deformers

    Paint Blend Shape Weights
  3. The model turns completely white, and the options open in the Tool Options box on the right side of the screen.

    In the Target box is the list of all the current Blend Shapes applied to the model. The white color on the model indicates that the Blend Shape weight is at full strength.

  4. Open the Blend Shape control window by choosing Window

    Paint Blend Shape Weights
  5. In the Paint Blend Shape Weights Tool options, set Paint Operation to Replace and Value to 0. Click the Flood button. This floods the model with a zero-weight value. The model turns black, and the mouthWide deformation disappears.

  6. Set Value to 1, and paint the area around the mouth on the model's left side. As you paint, you'll see the left side move into the mouthWide shape (see Figure 6.14).

  7. When you feel that you have painted enough of one side of the mouth, select the nancy model and duplicate it (Ctrl+d). Move the duplicate up and off to the side and name it mouthLeftWide (remember to name the deformers based on the character's left or right side, not your left or right).

    Activating the Paint Blend Shape Weights tool turns the model white, indicating that the selected target in the options is applied at full strength to all of the model's vertices.

    Figure 6.13. Activating the Paint Blend Shape Weights tool turns the model white, indicating that the selected target in the options is applied at full strength to all of the model's vertices.

    As the weights are painted, the side of the mouth moves into the mouth-Wide shape.

    Figure 6.14. As the weights are painted, the side of the mouth moves into the mouth-Wide shape.

  8. Select the nancy model again, and choose Edit Deformers

    As the weights are painted, the side of the mouth moves into the mouth-Wide shape.
  9. Flood the model with a zero value again, set Value to 1, and this time paint the mouth area on the model's right side.

  10. Duplicate the model again, and move the duplicate model up and away from the nancy model. Name this duplicate mouthRightWide.

  11. Select the nancy model again, and choose Edit Deformers

    As the weights are painted, the side of the mouth moves into the mouth-Wide shape.

    The two duplicate models will look somewhat strange; this is a very unusual expression (see Figure 6.15). You can use the Artisan Brush and the Move tool to make the mouth look more natural, but try to restrict your edits to one side of the mouth or the other. Remember that this particular mouth movement will most likely be accompanied by other shape changes during animation, which will make it look more natural. Most likely these shapes will not be used at their full strength, but it's good to model a little overshoot into the shape to expand the range of possible movements.

    Two new Blend Shape targets have been created using the Paint Blend Shape Weights tool.

    Figure 6.15. Two new Blend Shape targets have been created using the Paint Blend Shape Weights tool.

  12. Open the Blend Shape control window (Window

    Two new Blend Shape targets have been created using the Paint Blend Shape Weights tool.
  13. Select the nancy model, and choose Edit Deformers

    Two new Blend Shape targets have been created using the Paint Blend Shape Weights tool.
  14. Name the two new targets mouthRightNarrow and mouthLeftNarrow. At this point, you should have a total of six Blend Shape targets (see Figure 6.16).

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

    The scene is starting to fill up with Blend Shape targets.

    Figure 6.16. The scene is starting to fill up with Blend Shape targets.

Adding Targets

You can add the new targets to the existing Blend Shape deformer.

  1. Continue with the scene from the previous section or open the nancy_v04.ma scene from the chapter6scenes directory on the DVD.

  2. Select the nancy model, and choose Window

    Adding Targets
  3. Choose the mouthRightWide target and Shift+click the nancy model. Choose Edit Deformers

    Adding Targets
  4. Repeat step 3 for the mouthLeftWide, mouthRightNarrow, and mouthLeftNarrow targets.

  5. Save the scene as nancy_v05.ma. To see a version of the scene to this point, open the nancy_v05.ma scene from the chapter6scenes directory on the DVD.

    Sliders are added to the Blend Shape control window as the additional targets are added to the deformer.

    Figure 6.17. Sliders are added to the Blend Shape control window as the additional targets are added to the deformer.

Test the slider controls in the Blend Shape window. You can continue to edit the Blend Shapes targets after they have been added to the deformer. You may want to make additional changes to improve the expressions and the movement between shapes. Remember that at this point it's fine to have some strange-looking expressions. The final rig may have dozens of Blend Shape targets that all work together to create various expressions and facial movement. As long as you have the Blend Shape targets available, you can continue to refine the expressions by editing the targets.

Create a Custom Mouth Control Slider

You can animate the facial expressions by moving the sliders in the Blend Shape window and clicking the Key button beneath each slider. You can then use the Graph Editor to edit the animation curves. It is possible to animate this way, but you may find that as opposing shapes are animated, their animation curves start to overlap and create strange and unwanted facial movement.

There's a much better way to handle facial animation: create a set of intuitive interactive controls that you can move in the perspective view itself. These controls can be connected to the Blend Shape deformer using set driven keys. Animating the character will feel like moving a puppet, which will make your work easier and more enjoyable.

In this section, you'll see how to set up a basic interactive control to animate the Blend Shapes created in the previous section.

  1. Continue with the scene from the previous section or open the nancy_v05.ma scene from the chapter6scenes directory on the DVD.

  2. Once you have the Blend Shape deformer set up, you can safely delete the Blend Shape targets. Save a version with the targets just in case you need to go back and make a change. Then select the target models and delete them.

  3. Switch to a front view and turn on Grid Snapping. Choose Create

    Create a Custom Mouth Control Slider
  4. Name the curve wideNarrowCtrl. Select it and choose Modify

    Create a Custom Mouth Control Slider
  5. Use the Curve tool to create a triangle below the rectangle. Name the triangle wideNarrow. Center the pivot on the wideNarrow triangle (see Figure 6.18).

    A rectangle and a triangle are created using a linear curve.

    Figure 6.18. A rectangle and a triangle are created using a linear curve.

  6. Scale the wideNarrowCtrl down along the Y axis to about 0.15. Scale the wideNarrow triangle down to 0.3 in X and Y. Place the wideNarrow triangle just below the wideNarrowCtrl rectangle.

  7. Make two duplicates of the triangle and name one left and the other right.

  8. Scale the left and right triangles down to 0.1 in X and Y.

  9. Arrange the left and right triangles so they fit in the bottom half of the wideNarrow triangle. The left and right triangles correspond to the character's left and right sides, so the left triangle should be on the right and the right triangle should be on the left. This may seem confusing, but in a 3D scene the camera can be anywhere, so it's important to keep left and right relative to the character's point of view.

  10. Select the rectangle and the three triangles, and choose Modify

    A rectangle and a triangle are created using a linear curve.
  11. Parent the left and right triangles to the wideNarrow triangle, and parent the wideNarrow triangle to the wideNarrowCtrl rectangle.

  12. Select the wideNarrow triangle, and open its Attribute Editor to the wideNarrow tab. In the Limit Information rollout, expand the Translate controls. Check the boxes next to each Limit channel to turn on the translate limits. Set Trans Limit Y Min and Max to 0 and Trans Limit Z Min and Max to 0. Set Trans Limit X Min to −2 and the Trans Limit X Max to 2.

  13. Move the wideNarrow triangle back and forth along the X axis. It can travel the length of the wideNarrowCtrl rectangle but not beyond. This is one way to create a custom slider in Maya. When the Translate X channel of the triangle is set to 0, the triangle should be in the middle of the rectangle. Figure 6.19 shows the arrangement of the slider controls.

    Limits are set on the movement of the slider controls.

    Figure 6.19. Limits are set on the movement of the slider controls.

  14. Use the same technique to set limits on the translation of both the left and right triangles. They should be restricted so they can move only between −1 and 1 on the X axis. Their Y and Z axis limits Min and Max should be set to 0.

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

Connect the Slider to the Blend Shape

To make the slider functional, it will be connected to the Blend Shape using driven keys. The theory behind this arrangement is that you want to have opposing shapes on the opposite ends of a slider control. The mouthWide and the mouthNarrow shapes are connected to the X translation of the wideNarrow triangle, so the mouth is either wide or narrow but not both at the same time.

However, you also want to have enough freedom to control the sides of the mouth independently, so you'll connect the left and right triangles to the Blend Shapes for each side of the mouth. This way you still have the freedom to mix the Blend Shapes together to create a wide variety of possible mouth movements. This example uses only the wide and narrow controls. When you create similar controls for other mouth shapes, such as mouth corners down, lower lip curl, upper lip sneer, and so on, you end up with a very intuitive way to control the face by moving the sliders directly on the screen.

The next step in the process is creating the driven keys.

  1. Continue with the scene from the previous section or open the nancy_v06.ma scene from the chapter6scenes directory on the DVD.

  2. Make sure the Translate X channels for all of the triangles are set to 0. Make sure all of the Blend Shape controls are set to 0 as well so the face is in a neutral pose.

  3. From the Animation menu set choose Animate

    Connect the Slider to the Blend Shape
    Open the Set Driven Key window.

    Figure 6.20. Open the Set Driven Key window.

  4. Select the wideNarrow triangle, and click the Load Driver button in the Set Driven Key window. In the upper left of the Set Driven Key window, select wideNarrow. Its animation channels will appear in the upper right.

  5. From the Display menu in the Outliner, turn off the DAG Objects Only option so all of the nodes in the scene are visible. Select the nancyFace node, and click the Load Driven button in the Set Driven Key window.

    You need to set a keyframe so that when the wideNarrow triangle's Translate X channel is at 0, the mouthWide Blend Shape setting is also at 0.

  6. Select Translate X in the upper right of the Set Driven Key window and mouthWide in the lower right of the window, and click the Key button at the bottom of the Set Driven Key window (Figure 6.21).

  7. Click the wideNarrow label in the upper left of the Set Driven Key window. Open the Channel Box and set Translate X to −2.

  8. Select the nancyFace label in the lower left of the Set Driven Key window. In the Channel Box, set mouthWide to 1. Click the Key button at the bottom of the Set Driven Key window.

  9. Zoom out in the front view so you can see the control and the nancy character. Move the wideNarrow triangle back and forth along the slider. You should see the mouth move between the neutral pose (when wideNarrow is at the center of the slider) and the mouthWide shape (when wideNarrow is moved all the way to the left of the wideNarrowCtrl slider).

    The Set Driven Key window creates a keyframe relationship between the Translate X of wideNarrow and the mouthWide of nancyFace.

    Figure 6.21. The Set Driven Key window creates a keyframe relationship between the Translate X of wideNarrow and the mouthWide of nancyFace.

  10. Set wideNarrow back to 0 in the Translate X channel of the Channel Box. In the lower right of the Set Driven Key window, select mouthNarrow and click the Key button.

  11. Select wideNarrow in the upper left of the Set Driven Key window. In the Channel Box, set Translate X to 2.

  12. Select the nancyFace label in the lower left of the Set Driven Key window. In the Channel Box, set mouthNarrow to 1. In the Set Driven Key window, click the Key button.

  13. In the viewport, move the wideNarrow slider back and forth along the length of the wideNarrowCtrl. You'll see the face move between the mouthNarrow shape when the triangle is on the left side and the mouthWide shape when it's on the right side. Now the control is functional, and you can move between the two opposing mouth shapes using a single control.

  14. Create set driven keys for the small triangles named left and right. Use the following settings:

    • right Translate X = 0, mouthRightWide = 0

    • right Translate X = −1, mouthRightWide = 1

    • right Translate X = 0, mouthRightNarrow = 0

    • right Translate X = 1, mouthRightNarrow = 1

    • left Translate X = 0, mouthLeftWide = 0

    • left Translate X = 1, mouthleftWide = 1

    • left Translate X = 0, mouthLeftNarrow = 0

    • left Translate X = −1, mouthLeftNarrow = 1

    It seems a little tedious at first to create this kind of rig, but when you have the whole rig working, it's the easiest way to animate the face using blend shapes. Once you have all the driven keys created, spend some time moving the sliders back and forth. See how many mouth shapes you can create just by moving the sliders (see Figure 6.22).

    A variety of mouth shapes can be created by moving the triangle controls.

    Figure 6.22. A variety of mouth shapes can be created by moving the triangle controls.

  15. Save the scene as nancy_v07.ma. To see a finished version of the scene, open the nancy_v07.ma scene from the chapter6scenes directory on the DVD.

    There are many different ways to set up these types of controls. For a complex facial rig, try using curves to make controls that resemble a simplified face. This way you have a visual representation of how moving the controls affects the facial movements.

  16. Open the nancy_rig.ma scene from the chapter6scenes directory to see a more functional face and head rig. Play the animation to see the controls in action. Try moving various parts of the controls to see the resulting expressions (see Figure 6.23).

This rig uses a combination of Blend Shapes, joints, and a dynamic hair curve to create the various movements. A total of 49 Blend Shape targets were created for this rig. A more complete rig may use a hundred or more Blend Shape targets.

A more complete facial animation rig. The controls are positioned to give visual clues to the parts of the face they control.

Figure 6.23. A more complete facial animation rig. The controls are positioned to give visual clues to the parts of the face they control.

Create Blend Shape Sequences

When you choose the In Between setting in the Blend Shape options, the Blend Shape deformer deforms the base mesh based on a sequence created from multiple targets. The order in which you select the targets determines the sequence of the animation created when you move the Blend Shape slider. To understand this better, try this exercise, which uses a Blend Shape sequence to animate the growth of a snowflake crystal.

Create the Base Mesh

You'll start by creating the base mesh snowflake from a polygon prism using a series of polygon extrusions. It's important to name each extrude node as you create it so you can keep track of how it affects the shape of the snowflake.

  1. Create a new scene in Maya. Make sure Construction History is enabled.

  2. Switch to the Polygon menu set and choose Create

    Create the Base Mesh
  3. Open the Channel Box and select the polyPrism1 node from the INPUTS section. Set the Number Of Sides to 5 and the Length to 1 (see Figure 6.24).

    Create a five-sided prism.

    Figure 6.24. Create a five-sided prism.

  4. Right-click on the prism and choose Faces. Shift+click the five faces on the sides of the prism, but not the faces on the top or bottom.

  5. Choose Edit Mesh

    Create a five-sided prism.
  6. Click the polyExtrudeFace1 label in the Channel Box, and rename the node armRoot. Since you'll be editing a number of extrude nodes later on in the process, it's good to give them descriptive names so you can keep track of each of the extrusions.

  7. In the Channel Box, in the channels under the armRoot node, set Local Translate Z to 1.7 and Local Scale X and Local Scale Y to 0.5 (see Figure 6.25).

    Extrude the faces on the sides of the prism, and rename the extrusion node armRoot.

    Figure 6.25. Extrude the faces on the sides of the prism, and rename the extrusion node armRoot.

  8. With the faces on the end of each extrusion still selected, press the g hot key to repeat the last action, which creates another extrusion.

  9. Rename the new polyExtrudeFace1 node firstArmSection. Set its Local Translate Z channel to 1.5. Set all the Local Scale channels to 0.5. Set Number Of Divisions to 2.

  10. Shift+click the inside faces of the upper division on each of the arms of the snowflake, as shown in Figure 6.26. Press the g hot key to make another extrusion. Name this extrusion firstBranch.

  11. Set the Local Translate Z channel of the firstBranch node to 1. Set the Local Scale channels to 0.5.

  12. Select the face at the tip of each arm. Press the g hot key to create another extrusion. Name the extrusion firstTipSection. Set the Local Scale of firstTipSection to 2.

  13. Press the g hot key to make one last extrusion. Name the extrusion secondTipSection. Set the Local Translate Z channels of secondTipSection to 0.4 and the Local Scale channels to 0.4. Figure 6.27 shows the final snowflake.

  14. Rename the prism snowflakeFinal.

  15. Save the scene as snowflake_v01.ma.

Using a series of extrude operations, form the arms of the snowflake.

Figure 6.26. Using a series of extrude operations, form the arms of the snowflake.

The final shape of the snowflake after the extrusions have been applied

Figure 6.27. The final shape of the snowflake after the extrusions have been applied

Create the Blend Shape Targets

The sequence of Blend Shapes will be created using duplicates of the snowflake. You'll make a duplicate for each growth stage in the sequence, working backwards from the final snowflake shape.

  1. Continue with the scene from the previous section or open the snowflake_v01.ma scene from the chapter6scenes directory on the DVD.

  2. Select snowflakeFinal and choose Edit

    Create the Blend Shape Targets
    The options for Duplicate Special

    Figure 6.28. The options for Duplicate Special

  3. Name the duplicate snowflakeTips, and move it off to the side.

  4. Select snowflakeTips and open the Channel Box. Select the secondTipSection1 node, and set the Local Scale channels to 1 and Local Translate Z to 0 so the tips disappear. Do the same for the firstTipSection1 node.

  5. Select snowflakeTips and choose Edit

    The options for Duplicate Special
  6. In the Channel Box for snowflakeBranches, select the firstBranch2 node and set its Local Scale channels to 1 and its Local Translate Z to 0.

  7. Repeat this process until there are five duplicates of the snowflake. Each duplicate is a stage in the growth of the snowflake (see Figure 6.29). Name the last duplicate snowflakeStart. It should look just like the original five-sided prism.

  8. Save the scene as snowflake_v02.ma. To see a version of the scene to this point, open the snowflake_v02.ma scene from the chapter6scenes directory.

    Create a duplicate for each stage of the snowflake's growth.

    Figure 6.29. Create a duplicate for each stage of the snowflake's growth.

Create the Blend Shape Sequence

This process may seem a little strange, but it's important to remember that for the Blend Shape deformer to work correctly, the number of vertices and the point order of each model used in the Blend Shape deformer have to match. Therefore, it's best to work backwards from the finished model. You should be able to see at this point why naming each extrusion node is helpful. If the nodes do not have descriptive names, it's very hard to know which node corresponds to which part of a duplicate of the original snowflake, especially if you decide to make a more complex crystalline structure.

At this point the hard work is done; creating the Blend Shape sequence is very easy.

  1. Shift+click the snowflake models in the order of their stage of growth, but don't select the snowflakeStart model.

  2. With all of the models selected in the order of their growth stage, Shift+click the snowflakeStart model and switch to the Animation menu set. Choose Create Deformers

    Create the Blend Shape Sequence
    Enable the Inbetween option in the Create Blend Shape Options.

    Figure 6.30. Enable the Inbetween option in the Create Blend Shape Options.

  3. Choose Window

    Enable the Inbetween option in the Create Blend Shape Options.
  4. If you decide to change the order of the sequence, swap targets. Select two of the Blend Shape targets, and choose Edit Deformers

    Enable the Inbetween option in the Create Blend Shape Options.
  5. If you're happy with the final animation, delete all of the targets. Don't delete the snowflakeStart model.

  6. Save the scene as snowflake_v03.ma. To see a finished version of the scene, open the snowflake_v03.ma scene from the chapter6scenes directory on the DVD.

Use Lattices

Lattices are the most versatile deformers available in Maya. A lattice is a cube-shaped cage that surrounds the object. When the points of the lattice are moved, the surface of the object becomes deformed. Chapter 4 shows how a lattice can be used as a modeling tool. In this chapter, you'll animate a lattice to add cartoonish movement to a simple character.

Create a Lattice

Lattices can deform all types of geometry, groups, particles, and even other lattices. When you create a lattice, two nodes are added to the scene: lattice node, which is labeled ffd1Lattice (the number 1 changes depending on how many lattices are in the scene), and ffd1Base. The letters ffd stand for free-form deformer. When you edit the shape of the ffd1Lattice, Maya compares the differences in the shapes of the ffd1Lattice and the ffd1Base and makes changes to the deformed object relative to the differences between these two nodes.

  1. Open the mushroom_v01.ma scene from the chapter6scenes directory on the DVD. This scene shows three cartoon mushrooms on a hill.

  2. Select mushroom1Group in the Outliner, and choose Deformers

    Create a Lattice

    The lattice is automatically sized and scaled to surround the deformed object.

  3. Select the ffd1Lattice node and switch to the Move tool. Try moving the lattice; the entire mushroom1Group moves with it. The same is true as you scale or rotate the lattice.

    The lattice deformer appears as a cage over the mushroom1Group.

    Figure 6.31. The lattice deformer appears as a cage over the mushroom1Group.

    Since the lattice surrounds the entire group, moving it moves the whole mushroom. If you move the ffd1Base node, the mushroom character moves in the opposite direction and becomes mangled in the process. In most cases, you want to avoid moving the base node by itself (Figure 6.32).

    Moving the ffd1Base node badly distorts the mushroom1Group.

    Figure 6.32. Moving the ffd1Base node badly distorts the mushroom1Group.

  4. Undo any changes made to the ffd1Lattice and ffd1Base nodes. Shift+click both the ffd1Lattice and ffd1Base nodes, and move them together. When you move the nodes together, there's no change in the deformed object.

    If you need to reposition a lattice over part of a model or scale it so it engulfs a larger portion of the scene, remember to select both the ffd1Base and ffd1Lattice nodes together and make the changes while both nodes are selected. You can even group the nodes if that makes it easier.

  5. Right-click on the lattice and choose Lattice Point from the marking menu. Drag a selection marquee over some of the points and move them. The mushroom1Group becomes distorted again but in a more controllable manner (see Figure 6.33).

    Moving selected lattice points deforms the mushroom.

    Figure 6.33. Moving selected lattice points deforms the mushroom.

  6. Select the ffd1Lattice node, and open its Attribute Editor to the ffd1 tab. Disable the Local option. This makes the lattice deformations much smoother.

  7. Choose Edit Deformers

    Moving selected lattice points deforms the mushroom.
  8. Switch to the ffd1LatticeShape tab in the Attribute Editor, and experiment with changing the settings in the sliders for the S, T, and U divisions. These control how many divisions are along each axis of the lattice.

The axes of the lattice are specified using the letters S, T, and U, kind of like the X, Y, and Z axes of an object. A lattice point is placed at the intersection of each division. Each point has a certain amount of influence over the deformed object. When the Local option is enabled in the ffd1 tab, each point can deform only the parts of the object that are nearby. When Local is off, any changes to a lattice point's position affect the entire object, resulting in a smoother deformation. When local mode is enabled, you can set the strength of the local influence using the Local S, T, and U sliders.

The Outside settings in the ffd1 tab specify the amount of influence the lattice has over parts of the deformed object that lie outside the lattice cage. When Outside Lattice is set to Inside, changes to the lattice affect only the parts of the model inside the lattice. When this is set to All, changes to the lattice affect the entire object regardless of whether the parts are inside or outside the lattice. The Falloff setting specifies a range of distance. Parts of the object that fall within this distance are affected by changes to the lattice, but the strength of influence diminishes as the space between the object and the lattice increases. Figure 6.34 shows the settings available in the ffd1LatticeShape and ffd1 tabs of the Attribute Editor.

Options for the lattice can be set in the tabs of the lattice's Attribute Editor.

Figure 6.34. Options for the lattice can be set in the tabs of the lattice's Attribute Editor.

Animating Lattices

There are lots of ways to animate lattices. You can animate the transform node of the lattice or the individual points of the lattice; you can also apply deformers to the lattice and even bind a lattice to joints. In this example, a very simple animation is created by animating the transform node of the lattice.

  1. Continue with the scene from the previous section. Delete the ffd1Lattice node in the Outliner. The ffd1Base node will also be deleted.

  2. Select mushroomGroup1 and choose Deformers

    Animating Lattices
  3. Select the ffd1Lattice and ffd1Base nodes, and group them (hot key = Ctrl+g). Select the group, name it lattice, and center its pivot (Modify

    Animating Lattices
  4. Select the lattice group, and in the Channel Box, set Scale Y to 5.

  5. Expand the lattice group in the Outliner; then select the ffd1Lattice node. In the Channel Box, set the T Divisions to 20.

  6. Switch to a side view, right-click on the lattice, and choose Lattice Point. Hold the Shift key, and drag a selection marquee over every other row of points on the lattice.

  7. Switch to the Scale tool and push in the blue handle of the Scale tool to scale the lattice points along the Z axis. This creates an accordion shape in the lattice points (see Figure 6.35).

  8. Switch to the front view, and push in the red handle of the Scale tool to scale the points along the X axis.

  9. Select the lattice group and open the Channel Box. Highlight the Translate Y attribute. From the Channel Box menu, choose Edit

    Animating Lattices
  10. In the Expression field, type lattice.translateY=4*(sin(time));.

    A very tall lattice is created around the mushroom; the points of the lattice are scaled to create an accordion shape.

    Figure 6.35. A very tall lattice is created around the mushroom; the points of the lattice are scaled to create an accordion shape.

    This expression moves the lattice group up and down along the Y axis, using the sin of the current time multiplied by 4.

  11. Click the Create button to make the expression. Set the length of the timeline to 200, and play the animation (see Figure 6.36).

    Create an expression to automatically move the lattice up and down over time.

    Figure 6.36. Create an expression to automatically move the lattice up and down over time.

    The movement of the lattice group causes a wave-type distortion in the mushroom. This is an extremely simple application of the lattice deformer, but it gives you a good idea of how it works. Lattices become even more powerful when you combine them with other deformers and techniques.

  12. Save the file as mushrooms_v02.ma. To see a finished version of the scene, open the mushroom_v02.ma scene from the chapter6scenes folder of the DVD.

Animate Clusters

As deformers go, none are simpler or more useful than clusters. A cluster is a simple handle that can be applied to objects or components. Most often a cluster is applied to the vertices of an object. Think of a cluster as a way to group the vertices of one or more objects. You can then apply the cluster to animate the vertices.

In this section, you'll see a few ways to create, edit, and animate clusters.

Cluster Objects

You'll start by placing a cluster on a group.

  1. Open the tree_v01.ma scene from the chapter6scenes directory on the DVD. This scene consists of a polygon palm tree model created by converting a Paint Effects stroke into polygons.

  2. Select the palmTree group in the Outliner, and switch to the Animation menu set. Choose Create Deformers

    Cluster Objects
    The cluster appears as a small C in the viewport.

    Figure 6.37. The cluster appears as a small C in the viewport.

  3. Select the Move tool and move the cluster around. The palmTree group moves with the cluster.

  4. In the Outliner, select the cluster and Ctrl+click the palmTree group. Use the Move tool to move both objects.

    The movement created using the Move tool is doubled for the tree. This is an example of a double transform. This occurs when you move the object and the deformer; the translation of the deformer is added to the translation of the cluster.

  5. Undo all the changes you made with the Move tool. Try selecting the palmTree group and moving it. The cluster stays in its original position.

If you move the cluster now, it still works, but it has been offset from the deformed object. This is another situation you don't want. Once you cluster an object or part of an object, move the cluster by itself.

Paint Cluster Weights

The strength of cluster weights can be painted directly on an object.

  1. Continue with the previous scene, and return the cluster and the objects to their original position.

  2. Select the palmTree group, and choose Edit Deformers

    Paint Cluster Weights
  3. In the Tool Options box, set Paint Operation to Replace. Set Value to 0.

  4. Paint around the area of the trunk; it should turn black as you paint. The black color indicates that the strength values of the cluster at the trunk are now set to 0 (see Figure 6.38).

  5. Set Paint Operation to Smooth, and click the Flood button a few times to smooth the transition between the white and black areas.

  6. Select the cluster in the Outliner, and use the Move and Rotate tools to move it around. The trunk stays firmly planted in the ground (see Figure 6.39).

  7. Save the scene as tree_v02.ma. To see a version of the scene to this point, open the tree_v02.ma scene from the chapter6scenes directory on the DVD.

The cluster weights at the bottom of the tree are reduced using the Paint Attributes tool.

Figure 6.38. The cluster weights at the bottom of the tree are reduced using the Paint Attributes tool.

After you paint the weights of the cluster, the trunk stays in the ground when the cluster is moved.

Figure 6.39. After you paint the weights of the cluster, the trunk stays in the ground when the cluster is moved.

Cluster Components

The most common use for clusters is to directly deform components of an object. Clusters are a great way to attach CVs of a curve to another object.

  1. Create a new scene in Maya.

  2. Turn on Grid Snapping, and choose Create

    Cluster Components
  3. Right-click on the curve and choose Control Vertex so you can select the control vertices of the curve. Select one of the CVs at the end of the curve, and then Shift+click the other two CVs at the center of the curve.

  4. Choose Create Deformers

    Cluster Components
  5. Repeat steps 3 and 4, but this time select the CV at the opposite end of the curve as well as the two CVs in the middle. This is named cluster2Handle (be careful not to select cluster1Handle while you're selecting the middle CVs).

    You should end up with two clusters. The two CVs in the middle of the curve are deformed by both clusters. You can adjust the amount of influence each cluster has on the vertices using the Component Editor.

  6. Select the middle CV closest to cluster1Handle, and choose Window

    Cluster Components
  7. In the Component Editor, switch to the Weighted Deformer tab. Set the weight for cluster1 to 0.75 and the weight for cluster2 to 0.25. Together the weights add up to 1 (Figure 6.40).

  8. Select the middle CV closest to cluster2Handle. In the Component Editor, set the weight for cluster1 to 0.25 and the weight for cluster2 to 0.75.

  9. Close the Component Editor. In the perspective view, switch to the Move tool. Select cluster1Handle, hold the d key on the keyboard to switch to pivot point editing mode. While holding the d key, snap the pivot point for cluster1Handle to the CV at the closest end (see Figure 6.41).

    The weight for each cluster of the selected CV is entered numerically in the Component Editor.

    Figure 6.40. The weight for each cluster of the selected CV is entered numerically in the Component Editor.

    The pivot point for the cluster handle is moved to the end of the curve.

    Figure 6.41. The pivot point for the cluster handle is moved to the end of the curve.

  10. Repeat step 9 for cluster2Handle; snap its pivot point to the opposite end of the curve (closest to the cluster2Handle).

  11. Select cluster1Handle and move it around. You can now easily move one end of the curve, and there is a built-in falloff in strength down the length of the curve (Figure 6.42).

    Moving the cluster moves the end of the curve. The CVs in the middle of the curve are weighted to create a falloff in the strength of the clusters at either end.

    Figure 6.42. Moving the cluster moves the end of the curve. The CVs in the middle of the curve are weighted to create a falloff in the strength of the clusters at either end.

    It may look like the cluster is offset from the curve, but in fact the C in the viewport is placed an average distance away from the deformed CVs. The display of the deformer handle is not important at this point because the actual handle has been snapped to the end of the curve. You can see this in the position of the Move tool manipulator.

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

Constraining Clusters

Clusters can be parented to other objects, but I actually prefer using constraints. Using a constraint means that you don't have to worry about whether the cluster is set to Relative or not, and it reduces the chance of accidentally creating a double transformation. As long as you animate only the constraining objects and not the clusters themselves, you should be fine.

  1. Continue with the scene from the previous section or open the clusterCurve_v01.ma scene from the chapter6scenes directory on the DVD.

  2. Select both cluster handles, and make sure all of their Translate and Rotate channels are set to 0 in the Channel Box.

  3. Create a NURBS sphere. Move the sphere so its surface is placed at the edge of the curve closest to cluster1Handle. If the sphere radius is 1 unit and Grid Snapping is enabled, the surface of the sphere should touch the edge of the curve when the sphere is placed one unit beyond the end of the curve.

  4. In the Outliner, select the nurbsSphere1 node, and Ctrl+click cluster1Handle.

  5. From the Animation menu set, choose Constrain

    Constraining Clusters
    A sphere is placed at one end of the curve. The cluster1Handle is constrained to the sphere.

    Figure 6.43. A sphere is placed at one end of the curve. The cluster1Handle is constrained to the sphere.

    When you move or rotate the sphere, the curve travels with it.

  6. Repeat steps 3 through 5, and create a sphere for the opposite end of the curve. Constrain cluster2Handle to this sphere (Figure 6.44).

    The clusters are constrained to the spheres. A hose is created along the length of the curve using a Paint Effects curve that has been converted to polygons.

    Figure 6.44. The clusters are constrained to the spheres. A hose is created along the length of the curve using a Paint Effects curve that has been converted to polygons.

    Try extruding a circle along the length of the curve, or attach a Paint Effects stroke to the curve (consult Chapter 3 for information on extruding along paths). Chapter 4 demonstrates how to model using Paint Effects. This is a great way to create a simple hose that connects two pieces of geometry. This technique works pretty well for many situations; however, you may experience some flipping of the curve when the spheres are rotated.

  7. Save the scene as clusterCurve_v02.ma. To see a version of the scene to this point, open the clusterCurve_v02.ma scene from the chapter6scenes directory on the DVD.

Nonlinear Deformers

The nonlinear deformers include the bend, flare, sine, twist, squash, and wave deformers. The names of the deformers give a pretty good indication of what they do. They work well for creating cartoonish effects and even do a decent job of faking dynamic effects, saving you from the extensive setup many dynamic simulations require. All of the nonlinear deformers work the same way. The deformer is applied to a surface, a lattice, components, or a group of surfaces, and then parameters are edited to achieve the desired effect. The parameters can be animated as well. You can use nonlinear deformers in combination with each other and other deformers.

In this section, you'll use nonlinear deformers to animate a jellyfish bobbing in the ocean. You'll use just a few of the deformers to create the scene, but since they all work the same way, you can apply what you've learned to the other nonlinear deformers in your own scenes.

The Wave

The wave deformer creates a ring of sine waves like a circular ripple in a puddle. To create the gentle bobbing up and down of a jellyfish, you'll animate the parameters of a wave deformer.

  1. Open the jellyfish_v01.ma scene from the chapter6scenes directory on the DVD.

    This scene contains a very simple jellyfish model. The model consists of the body of the jellyfish and its tendrils. All the surfaces are NURBS. The tendrils, which were created by converting Paint Effects strokes to NURBS surfaces, are grouped together and then grouped again with the body (see Figure 6.45).

  2. Select the jellyFish group in the Outliner. Switch to the Animation menu set, and choose Create Deformers

    The Wave
  3. Select wave1Handle and open its Attribute Editor. Click the wave1 tab. The tab contains the parameters for the deformer.

  4. Set Amplitude to 0.041. The Amplitude increases the height of the sinusoidal wave. This is displayed in the wireframe deformer handle in the viewport. Notice that the jellyfish is now distorted.

  5. Set Wavelength to 0.755; this decreases the distance between the peaks and valleys of the sine wave, creating a long, smooth type of distortion (see Figure 6.46).

    The jellyfish model is created from groups of NURBS surfaces.

    Figure 6.45. The jellyfish model is created from groups of NURBS surfaces.

    The settings on the wave1 tab change the shape of the wave deformer.

    Figure 6.46. The settings on the wave1 tab change the shape of the wave deformer.

  6. Select the wave1Handle node, and use the Move tool to position it at the center of the jellyfish body. Set the Translate coordinates as follows:

    • Translate X: 0

    • Translate Y: 0.787

    • Translate Z: −.394

  7. Set all three Scale channels to 30.

  8. To animate the bobbing motion, create a simple expression that connects the Offset value to the current time. Open the Attribute Editor for wave1Handle to the wave1 tab. In the field next to Offset, type =time; (see Figure 6.47), and press the Enter key.

    The Offset attribute is connected to time.

    Figure 6.47. The Offset attribute is connected to time.

  9. Set Min Radius to 0.1. If you switch to wireframe display, you'll see that a circle has appeared at the center of the handle.

    The deformer now affects only the areas between the edge of the min radius and the outer edge of the deformer. You can set a range of deformation by adjusting the Min and Max Radius sliders. Dropoff reduces the amplitude of the deformer at the outer edges of the range. Setting Dropoff to −1 reduces the amplitude at the center of the deformer.

  10. Save the scene as jellyfish_v02.ma. To see a version of the scene up to this point, open the jellyfish_v02.ma scene from the chaper6scenes directory on the DVD.

Squash

The squash deformer can actually both squash and stretch objects. It works well for cartoony effects. In this section, you'll add it to the jellyfish to enhance the bobbing motion created by the wave deformer.

  1. Continue with the scene from the previous section or open the jellyfish_v02.ma scene from the chapter6scenes directory on the DVD.

  2. Switch to the Animation menu set. Select the jellyFish group in the Outliner, and choose Create Deformers

    Squash
  3. Select squash1Handle in the Outliner, use the Move tool to position the handle at the center of the jellyfish. Set the Translate channels to the following:

    • Translate X: 0

    • Translate Y: 1.586

    • Translate Z: 0

  4. Select the squash1Handle, and open the Attribute Editor to the squash1 tab. The Low and High Bound sliders set the overall range of the deformer. Leave Low Bound at −1, and set High Bound to 0.5 (see Figure 6.48).

    You can animate any of the settings to add motion to the jellyfish. In this case, you'll add an expression to the Factor of squash1. Setting Factor to a positive value stretches the object; setting Factor to a negative value squashes the object. For the jellyfish, animating between squash and stretch helps make the model appear as though it's floating in water. You can use a sin function as part of an expression that smoothly animates the Factor value between positive and negative values.

  5. In the field next to Factor, type =0.25*(sin(time*2)); and hit the Enter key.

    Multiplying time by 2 speeds up the animation of the values. Multiplying the entire expression by 0.25 keeps the range of values between −0.25 and 0.25. Going beyond this range deforms the jellyfish a bit too much.

    Factor controls the vertical displacement created by the squash deformer; the Expand setting controls the horizontal displacement created by the effect.

  6. Set Expand to 2. Set Max Expand Pos to 0.78. This places the vertical position of the center of the effect along the length of the deformer.

  7. Save the scene as jellyfish_v03.ma. To see a version of the scene to this point, open the jellyfish_v03.ma scene from the chapter3scenes directory on the DVD.

The squash deformer settings appear in the Attribute Editor.

Figure 6.48. The squash deformer settings appear in the Attribute Editor.

Twist

The twist deformer twists an object around a central axis. You'll add this to the jellyfish to create some additional motion for the tendrils.

  1. Continue with the scene from the previous section or open the jellyfish_v03.ma scene from the chapter6scenes directory on the DVD.

  2. In the Outliner, expand the jellyFish group and select the tendrils group. Choose Create Deformers

    Twist
  3. Select twist1Handle in the Outliner, and set the Translation channels to the following:

    • Translate X: 0

    • Translate Y: −18

    • Translate Z: 0

  4. Open the Attribute Editor for twist1Handle to the twist1 tab.

    Just like for the squash deformer, you can specify the range of the effect of the deformer using the Low Bound and High Bound sliders.

  5. Set Low Bound to −1 and High Bound to 0.825.

    The Start Angle and End Angle values define the amount of twist created along the object. If you move the End Angle slider, the top of the tendrils spin around even if they are outside the High Bound range. Moving the Start Angle slider twists the tendrils at their ends, which is more like the effect you want. You can use a simple noise expression to create a smooth type of random oscillation between values. Since the Start Angle is specified in degrees, you can multiply the noise expression by 36. to get a full range of twisting motion.

  6. In the Start Angle field, type =36.*(noise*(time*0.1));. Multiplying time by 0.1 slows down the motion of the twisting.

  7. Rewind and play the animation. You're on your way to creating an interesting jellyfish motion (see Figure 6.49).

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

Try adding additional nonlinear deformers to the jellyfish.

The jellyfish is animated using a number of nonlinear deformers.

Figure 6.49. The jellyfish is animated using a number of nonlinear deformers.

Create Jiggle Deformers

A jiggle deformer is a very simple way to add a jiggling motion to deformed objects. Jiggle deformers do not have the same level of control as dynamic systems such as nucleus, fluids, or hair. Jiggle deformers are best used as a substitute for dynamics when the situation requires just a little jiggly motion.

Apply Jiggle Deformers

There aren't very many options for creating jiggle deformers. To apply a jiggle deformer, select the object you want to jiggle and create the deformer. In this section, you'll add the jiggle to the jellyfish.

  1. Continue with the scene from the previous section or open the jellyfish_v04.ma scene from the chapter6scenes directory on the DVD.

  2. Select the jellyFish group in the Outliner. Choose Create Deformers

    Apply Jiggle Deformers
  3. In the options, set Stiffness to 0.1 and Damping to 0.8. A higher Stiffness setting creates more of a vibrating type of jiggle; lowering the Stiffness value makes the jiggle more jellylike.

  4. Click Create to make the deformer. You won't see any new nodes appear in the Outliner because the Display option is set to DAG Objects Only.

    If you turn off the DAG Objects Only option in the Outliner, you'll see that a jiggle deformer is created for each surface. A jiggle cache is created to aid in calculation and playback of the scene (Figure 6.50).

  5. Rewind and play the scene; you'll see that the jellyfish has a jiggling motion, especially in the tendrils.

A node for each jiggle deformer applied to the surfaces appears in the Outliner

Figure 6.50. A node for each jiggle deformer applied to the surfaces appears in the Outliner

If you want to edit the settings of all of the jiggle deformers at once (since there are so many tendrils, a lot of deformer nodes were created), disable the DAG Objects Only option in the Outliner's Display menu, Shift+click all of the jiggle nodes, and then edit the settings in the Channel Box. When you have multiple objects selected, editing the settings in the Channel Box applies the settings to all of the selected objects. This is not true when working in the Attribute Editor.

Paint Jiggle Weights

The jiggle effect looks good in the area of the tendrils, but it's a little too strong on the top of the jellyfish body. You can edit the weights of the deformer interactively using the Paint Jiggle Weights Tool.

  1. Select the jellyFishBody node in the Outliner, and choose Edit Deformers

    Paint Jiggle Weights
  2. In the Options box, set Paint Operation to Replace and Value to 0. Paint the area at the top of the jellyfish body.

  3. Set Paint Operation to Smooth and click the Flood button a few times to smooth the overall weighting (see Figure 6.51).

    Paint the weights of the jiggle deformer on the top of the jellyfish body and then smooth them using the Flood button.

    Figure 6.51. Paint the weights of the jiggle deformer on the top of the jellyfish body and then smooth them using the Flood button.

  4. Rewind and play the animation. The jiggling is not quite as strong on the top of the jellyfish.

  5. Save the scene as jellyfish_v05.ma. To see a version of the scene to this point, open the jellyfish_v05.ma scene from the chapter6scenes directory on the DVD.

Use the Geometry Cache

When you create a geometry cache for animated geometry, a series of files are written to your computer's hard drive that store the position of each of the points of the specified geometry over time. Once you create a geometry cache, when you play the scene back the cached geometry will play much closer to real time. You can add more deformers and animation to the cached geometry, and you can also alter the playback speed of the cached geometry.

In this section, you'll cache the animation for the jellyfish and then use the geometry cache settings to slow the playback of the jellyfish so the floating motion looks more natural.

Create a Geometry Cache

The motion-deformed jellyfish looks pretty good as a simple animation. However, after all the deformers have been combined and the jiggle has been added, the motion looks a little too fast for a convincing deep sea environment. Obviously you can continue to edit the expressions used on the deformers, but in this section you'll take a shortcut by using a geometry cache.

  1. Continue with the scene from the previous section or open the jellyfish_v05.ma scene from the chapter6scenes directory on the DVD.

    Unless you have a very powerful computer, most likely the playback of the jellyfish is not quite in real time. It may look alright in the scene view, but when you create a Playblast, you'll see that the overall motion is too fast.

  2. In the viewport panel menu disable the display of deformers in the Show menu so you can clearly see the jellyfish.

  3. Choose Window

    Create a Geometry Cache
  4. Set the Display Size to From Window, and use the Scale slider to determine the size of the movie.

  5. Click the Playblast button in the options. Maya will play through the animation and take a screenshot of each frame as it plays. When it's finished, you can watch the movie play back in the default media viewer or in FCheck (see Figure 6.52).

    To create a geometry cache, you need to select the geometry nodes; selecting group nodes or parents of the geometry nodes won't work.

  6. In the Outliner, hold the Shift key and click the plus sign next to the jellyfish group to expand the group and the tendrils group at the same time.

    The options for creating a Playblast

    Figure 6.52. The options for creating a Playblast

  7. Shift+click all the tendril objects and the jellyFishBody surface.

  8. From the Animation menu set, choose Geometry Cache

    The options for creating a Playblast
  9. In the options, you can use the Base Directory field to specify a directory for the cache. By default the cache is created in the Data folder for the current project. If you will be rendering across computers on a network, make sure all of the computers have access to the directory that contains the cache.

  10. Name the cache jellyfish. Set the File Distribution to 1 file and the Cache Time Range to Time Slider.

  11. Click Create to make the cache. Maya will play through the animation and write the cache files to disk.

  12. When Maya has completed the cache, it should automatically be applied to the jellyfish. To prove this, you can select the deformers in the scene, delete them, and then play back the animation. The jellyfish should still bob up and down.

Editing the Cache Playback

Once the cache has been created, you can use the settings in the cache node to change the speed of the playback. This will create a more believable motion for the jellyfish.

  1. Select any of the surfaces in the jellyfish (not the jellyfish group node), and open the Attribute Editor.

  2. Switch to the jellyfishCache1 tab. Set the Scale attribute to 5. This scales the length of the animation to be five times its original length, thus slowing down the speed of playback (see Figure 6.53).

  3. Set the length of the timeline to 1000. The original 200-frame animation has been scaled to 1000 frames.

  4. Create a Playblast. You'll see that the jellyfish is now much slower and looks more like an undersea creature

    Once you have created a cache you can add additional deformers, animate the movement of the jellyfish group, and even make animated copies.

  5. Select the jellyFish group and choose Edit

    Editing the Cache Playback
  6. Move the copy away from the original, and rotate it on its Y axis so it does not look exactly like the original.

  7. Make a few more copies like this to create a small jellyfish army. Play back the animation to see the army in action (see Figure 6.54).

The options for the geometry cache playback

Figure 6.53. The options for the geometry cache playback

Duplicates of the original jellyfish are created to make a small jellyfish army.

Figure 6.54. Duplicates of the original jellyfish are created to make a small jellyfish army.

The Bottom Line

Animate facial expressions

Animated facial expressions are a big part of character animation. It's common practice to use a Blend Shape deformer to create expressions from a large number of Blend Shape targets. The changes created in the targets can be mixed and matched by the deformer to create the expressions and speech for a character.

Master it

Create Blend Shape targets for the nancy character. Make an expression where the brows are up and the brows are down. Create a rig that animates each brow independently.

Create Blend Shape sequences

Blend Shapes can be applied in a sequential order to animate a sequence of changes over time.

Master it

Create a Blend Shape sequence of a mushroom growing.

Use lattices

Lattices are freeform deformers that create a 3D cage around an object. The differences between the lattice and the lattice base are used to deform geometry.

Master it

Animate a cube of jelly squishing along a path.

Animate clusters

Clusters are simple deformers that are most often used to animate the vertices of geometry.

Master it

Create an animated garden hose using clusters.

Animate nonlinear deformers

Nonlinear deformers apply simple changes to geometry. The deformers are controlled by animating the attributes of the deformer.

Master it

Animate an eel swimming past the jellyfish we created in this chapter.

Use jiggle deformers

Jiggle deformers add a simple jiggling motion to animated objects.

Master it

Add a jiggling motion to the belly of a character.

Use the geometry cache

Geometry caches store the animation information of each vertex of a piece of geometry. The Cache controls can be used to speed up or slow down the animation of a cached object.

Master It

Create a slow-motion effect for an animation that uses a deformer.

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

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