Squash deformer example

 
 
 

Squashing a sphere onto the ground

By default, Maya places nonlinear deformer handles at the center of the object to be deformed. For instance, when you create a sphere and create a squash deformer for it, Maya places the squash deformer handle at the center of the sphere. The deformation will be relative to the sphere’s center. If you want to squash the sphere against the ground, you can adjust the squash deformer’s attributes and move the squash deformer handle so that the deformation will be relative to where the sphere touches the ground. In general, you can make these adjustments so that the squashing effect can occur relative to any location inside or outside of the sphere.

To set up the sphere and the deformer

  1. Create a primitive NURBS sphere.
  2. Press the 3 number key to increase the display resolution.
  3. Move the sphere so that it is sitting on the grid in a perspective view.
  4. Create a squash deformer for the sphere.

To edit the deformer

  1. Edit the squash deformer by setting squash1’s attributes as follows:

    Low Bound: 0

    High Bound: 0.75

  2. Move the deformer handle so the lower boundary is where the sphere is making contact with the ground.

To squash the sphere against the ground

  1. Now, from the Channel Box, change the Factor.

    The squash deformation takes place relative to the bottom of the sphere, where the sphere is touching the ground.

Bouncing ball setup

You can create squash and stretch effects with the squash deformer. This example shows how you can set up a ball for a bouncing ball animation.

To create NURBS sphere with squash control

  1. Do the previous example.
  2. Set squash1’s Factor attribute back to 0.

To create deformer for stretch control

  1. Create another squash deformer for the sphere to provide stretch control. Use the default creation options.

    The squash1 deformer provides the squashing that occurs when the ball lands on the ground. The deformer you’ve just created (squash2) will provide the stretching that will occur when the ball is in flight.

To define the ball

  1. Group the sphere (nurbsSphere1) and the deformer handles (squash1Handle and squash2Handle).
  2. Rename the group ball.
  3. Open the Channel Control window (Window > General Editors > Channel Control), and make the following attributes Non Keyable:
    • scaleX, scaleY, scaleZ
    • visibility

    The Channel Box now lists only the following keyable attributes for ball: Translate X, Translate Y, Translate Z, Rotate X, Rotate Y, and Rotate Z.

  4. Close the Channel Control window.

    Now you will add two attributes to the ball for squashing and stretching.

  5. With the ball selected, select Modify > Add Attribute.
    • Add a keyable attribute called flyStretch, with the following Min/Max Values: Minimum 0, Maximum 10, Default 0.
    • Add a keyable attribute called landSquash, with the following Min/Max Values: Minimum 0, Maximum 10, Default 0.
  6. Close the Add Attribute window.

To set driver and driven keys for stretching

  1. Open the Set Driven Key window (Animate > Set Driven Key > Set > ).
  2. Load ball as driver, select flyStretch attribute, and set the attribute to 0.
  3. Load squash2 as driven, select factor attribute, and set the attribute to 0.
  4. Click Key.
  5. Set ball’s flyStretch attribute to 10.
  6. Set squash2’s factor attribute at 0.6.
  7. Click Key.

To set driver and driven keys for squashing

  1. Open the Set Driven Key window if it is not already opened.
  2. Load ball as driver, select landSquash attribute, and set the attribute to 0.
  3. Load squash1 as driven, select factor attribute, and set the attribute to 0.
  4. Click Key.
  5. Set ball’s landSquash attribute to 10.
  6. Set squash1’s factor attribute at -2.
  7. Click Key.
  8. Click Close to close the editor.

    Now the ball is ready for a bouncing ball animation with squash and stretch effects.

Animating the ball

You’ve now set up the ball for animation. Try creating an animation of the ball bouncing. Include stretch effects when the ball is in flight and squash effects when the ball hits the ground. For example, your animation might look something like the following images.

These images show just a simple example of a bouncing ball. As you develop your animation of a bouncing ball, try to see how much “character” you can give to the ball’s movements.

Creative Commons License Except where otherwise noted, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License