Chapter 21. Animating with Constraints and Controllers

When you first begin animating and working with keys, having Max figure out all the frames between the start and end keys seems amazing, especially if you've ever animated in 2D by drawing every frame. But soon you realize that animating with keys can be time-consuming for complex realistic motions, and again, Max comes to the rescue. You can use animation constraints and controllers to automate the creation of keys for certain types of motions.

Constraints and controllers store and manage the key values for all animations in Max. When you animate an object using the Auto Key button, the default controller is automatically assigned. You can change the assigned controller or alter its parameters using the Motion panel or the Track View.

This chapter explains how to work with constraints and controllers and examines all the various types that are available. For example, you can use the Noise controller to add random motion to a flag blowing in the wind, the Surface constraint to keep a bumper car moving over the surface, or the Waveform controller to produce regular repeating motions such as a sine or square wave.

Restricting Movement with Constraints

The trick of animating an object is to make it go where you want it to go. Animating objects deals not only with controlling the motion of the object, but also with controlling its lack of motion. Constraints are a type of animation controller that you can use to restrict the motion of an object.

Using these constraints, you can force objects to stay attached to another object or follow a path. For example, the Attachment constraint can be used to make a robot's feet stay connected to a ground plane as it moves. The purpose of these constraints is to make animating your objects easier.

Using constraints

You can apply constraints to selected objects using the Animation

Using constraints
Using constraints

After you select one of the constraints from the Animation

Using constraints
Using constraints

Note

Find out more about the Track View window in Chapter 34, "Working with Function Curves in the Track View."

Working with the constraints

Each constraint is slightly different, but learning how to use these constraints will help you control the animated objects within a scene. You can apply several constraints to a single object. All constraints that are applied to an object are displayed in a list found in the Motion panel. From this list, you can select which constraint to make active and which to delete. You can also cut and paste constraints between objects.

Attachment constraint

The Attachment constraint determines an object's position by attaching it to the face of another object. This constraint lets you attach an object to the surface of another object. For example, you could animate the launch of a rocket ship with booster rockets that are attached with the Attachment constraint. The booster rockets would move along with the ship until the time when they are jettisoned.

The pivot point of the object that the constraint is applied to is attached to the target object. At the top of the Attachment Parameters rollout is a Pick Object button for selecting the target object to attach to. You can use this button to change the target object or to select the target object if the Animation

Attachment constraint

Note

The Attachment constraint shows up in the Position track of the Assign Controller rollout as the Position List controller. To minimize the effect of other controllers, set their Weight values in the Position List rollout to 0.

The Key Info section of the Attachment Parameters rollout displays the key number and lets you move between the various keys. The Time value is the current key value. In the Face field, you can specify the exact number of the face to attach to. To set this face, click the Set Position button and drag over the target object. The A and B values represent Barycentric coordinates for defining how the object lies on the face. You can change these coordinate values by entering values or by dragging the red crosshairs in the box below the A and B values. The easiest way to position an object is to use the Set Position button to place the object and then to enhance its position with the A and B values. The Set Position button stays active until you click it again.

The TCB section sets the Tension, Continuity, and Bias values for the constraint. You can also set the Ease To and Ease From values.

Tutorial: Attaching eyes to a melting snowman

When part of a model is deformed, such as applying the Melt modifier to a snowman's body, smaller parts like the eyes either get left behind or get the full weight of the modifier applied to them. If the Melt modifier weren't applied to these items, they would stay floating in the air while the rest of the snowman melted about them. This problem can be fixed with the Attachment constraint, which causes the eyes to remain attached to the snowball as it melts.

Note

The tutorial where the Melt modifier is applied to the snowman is included in Chapter 32, "Using Animation Modifiers."

To constrain the solid objects to a melting snowman, follow these steps:

  1. Open the Melting snowman.max file from the Chap 21 directory on the DVD.

    This file includes the melting snowman file from the previous chapter with the Melt modifier applied to all objects.

  2. Select the left eye object in the scene. In the Modifier Stack, select the Melt modifier and click the Remove Modifier button to throw that modifier away.

  3. With the left eye still selected, select Animation

    Tutorial: Attaching eyes to a melting snowman
  4. In the Attachment Parameters rollout, change the Face value until the eye is positioned where it should be. This should be around face 315. Then change the A and B values (or drag in the Position graph) to position the eye where it looks good.

  5. Repeat Step 5 for the right eye and for any other objects in the scene that you want to attach.

  6. Click the Play button (/), and notice that the snow melts, but the eye objects stay the same size.

Figure 21.1 shows the resulting melted snowman.

The Attachment constraint sticks one object to the surface of another.

Figure 21.1. The Attachment constraint sticks one object to the surface of another.

Surface constraint

The Surface constraint moves an object so that it is on the surface of another object. The object with Surface constraint applied to it is positioned so that its pivot point is on the surface of the target object. You can use this constraint only on certain objects, including Spheres, Cones, Cylinders, Toruses, Quad Patches, Loft objects, and NURBS objects.

In the Surface Controller Parameters rollout is the name of the target object that was selected after the menu command. The Pick Surface button enables you to select a different surface to attach to. You can also select specific U and V Position values. Alignment options include No Alignment, Align to U, Align to V, and a Flip toggle.

Note

Don't be confused because the rollout is named Surface Controller Parameters instead of Surface Constraint Parameters. The developers at Autodesk must have missed this one.

Tutorial: Rolling a tire down a hill with the Surface constraint

Moving a vehicle across a landscape can be a difficult procedure if you need to place every rotation and position key, but with the Surface constraint, it becomes easy. In this tutorial, you use the Surface constraint to roll a tire down a hill.

To roll a tire down a hill with the Surface constraint, follow these steps:

  1. Open the Tire rolling on a hill.max file from the Chap 21 directory on the DVD.

    This file includes a patch grid hill and a wheel object made from primitives.

  2. Create a dummy object from the Helpers category, and link the tire object to it as a child. This causes the tire to move along with the dummy object. Position the dummy object's pivot point at the bottom of the tire and the top of the hill. The pivot point can be moved using the Affect Pivot Only button in the Hierarchy panel.

  3. Select the dummy object, choose Animation

    Tutorial: Rolling a tire down a hill with the Surface constraint
  4. In the Surface Controller Parameters rollout, select the Align to V and Flip options to position the dummy and tire objects at the top of the hill. Set the V Position value to 50 to move the tire down the hill.

  5. Click the Auto Key button (or press the N key), drag the Time Slider to frame 100, and change the U Position to 100. Click the Animate button again to deactivate it, and click the Play Animation button to see the tire move down the hill.

Figure 21.2 shows the tire as it moves down the hill. In the Top view, you can see the function curves for this motion.

The Surface constraint can animate one object moving across the surface of another.

Figure 21.2. The Surface constraint can animate one object moving across the surface of another.

Path constraint

The Path constraint lets you select a spline path for the object to follow. The object is locked to the path and follows it even if the spline is changed. This is one of the most useful constraints because you can control the exact motion of an object using a spline. With Max's spline features, you can control very precisely the motions of objects that are constrained with the Path constraint. A good example of this constraint is an animated train following a track. Using a spline to create the train tracks, you can easily animate the train using the Path constraint.

When you choose the Animation

Path constraint

The Path Parameters rollout also includes Add and Delete Path buttons for adding and deleting paths to and from the list. If two paths are added to the list, then the object follows the position centered between these two paths. By adjusting the Weight value for each path, you can make the object favor a specific path.

The Path Options include a % Along Path value for defining the object's position along the path. This value ranges from 0 at one end to 100 at the other end. The Follow option causes the object to be aligned with the path as it moves, and the Bank option causes the object to rotate to simulate a banking motion.

The Bank Amount value sets the depth of the bank, and the Smoothness value determines how smooth the bank is. The Allow Upside Down option lets the object spin completely about the axis, and the Constant Velocity option keeps the speed regular. The Loop option returns the object to its original position for the last frame of the animation setting up a looping animation sequence. The Relative option lets the object maintain its current position and does not move the object to the start of the path. From its original position, it follows the path from its relative position. At the bottom of the Path Parameters rollout, you can select the axis to use.

Tutorial: Creating a spaceship flight path

Another way to use splines is to create animation paths. As an example, you use a Line spline to create an animation path. You can use splines for animation paths in two ways. One way is to create a spline and have an object follow it using either the Path constraint or the Path Follow Space Warp. The first vertex of the spline marks the first frame of the animation. The other way is to animate an object and then edit the Trajectory path.

In this tutorial, you use a simple path and attach it to a spaceship model. Viewpoint Datalabs provided the spaceship model.

To attach an object to a spline path, follow these steps:

  1. Open the Spaceship and asteroids.max file from the Chap 21 directory on the DVD.

    This file contains the spaceship model and several asteroid objects.

  2. Select Create

    Tutorial: Creating a spaceship flight path
  3. With the spaceship selected, choose Animation

    Tutorial: Creating a spaceship flight path
  4. Click the Play Animation button in the Time Controls to see the spaceship follow the path.

Figure 21.3 shows the spaceship as it moves between the asteroids.

The spaceship object has been attached to a spline path that it follows.

Figure 21.3. The spaceship object has been attached to a spline path that it follows.

Position constraint

You can use the Position constraint to tie the position of an object to the weighted position of several target objects. For example, you could animate a formation of fighter jets by animating one of the jets and using Position constraints on all adjacent jets.

The Position constraint menu option lets you select a single target object, enabling you to place the pivot points of the two objects on top of one another. To add another target object, click the Add Position Target button in the Position Constraint rollout in the Motion panel. This button enables you to select another target object in the viewports; the target name appears within the target list in the rollout.

If you select a target name in the target list, you can assign a weight to the target. The constrained object is positioned close to the object with the higher weighted value. The Weight value provides a way to center objects between several other objects. The Keep Initial Offset option lets the object stay in its current location, but centers it relative to this position.

Figure 21.4 shows a sled positioned between four tree objects using the Position constraint. Notice how the weight of the downhill tree object is weighted higher than the other targets and the sled is close to it.

You can use the Position constraint to control the position of an object in relation to its targets.

Figure 21.4. You can use the Position constraint to control the position of an object in relation to its targets.

Link constraint

The Link constraint can transfer hierarchical links between objects. This constraint can cause a child's link to be switched during an animation. Anytime you animate a complex model with a dummy object, the Link constraint makes it possible to switch control from one dummy object to another during the animation sequence. This keeps the motions of the dummy objects simple.

The Link Params rollout includes Add Link and Delete Link buttons, a list of linked objects, and the Start Time field. To switch the link of an object, enter for the Start Time the frame where you want the link to switch, or drag the Time Slider and click the Add Link button. Then select the new parent object. The Delete key becomes active when you select a link in the list.

Note

If you create a link using the Link constraint, the object is not recognized as a child in any hierarchies.

All links are kept in a list in the Link Params rollout. You can add links to this list with the Add Link button, create a link to the world with the Link to World button, or delete links with the Delete Link button. The Start Time field specifies when the selected object takes control of the link. The object listed in the list is the parent object, so the Start Time setting determines when each parent object takes control.

The Key Mode section lets you choose a No Key option. This option does not write any keyframes for the object. If you want to set keys, you can choose the Key Nodes options and set keys for the object itself (Child option) or for the entire hierarchy (Parent option). The Key Entire Hierarchy sets keys for the object and its parents (Child option) or for the object and its targets and their hierarchies (Parent option).

This constraint also includes the PRS Parameters and Key Info rollouts.

Warning

You cannot use Link constraints with Inverse Kinematics systems.

Tutorial: Skating a figure eight

For an animated object to switch its link from one parent to another halfway through an animation, you need to use the Link constraint. Rotating an object about a static point is easy enough: Simply link the object to a dummy object, and rotate the dummy object. The figure-eight motion is more complex, but you can do it with the Link constraint.

To move an object in a figure eight, follow these steps:

  1. Open the Figure skater skating a figure eight.max file from the Chap 21 directory on the DVD.

    This file includes a figure skater model imported from Poser and two dummy objects. The figure skater is linked to the first dummy object.

  2. Click the Auto Key button (or press the N key), drag the Time Slider to frame 100, and rotate the first dummy object two full revolutions in the Top viewport.

  3. Select the second dummy object, and rotate it two full revolutions in the opposite direction. Click the Auto Key button again to deactivate it.

    Tip

    If you enable the Angle Snap Toggle button on the main toolbar, then it is easier to rotate objects exactly two revolutions.

  4. With the figure skater selected, choose Animation

    Tutorial: Skating a figure eight

    The Link constraint is assigned to the figure skater.

  5. In the Link Params rollout, click the Add Link button. With the first dummy object selected in the viewport, set the Start Time value to 0. Then click the second dummy object, and set the Start Time to 25. Finally, click the first dummy object again, and set the Start Time to 75.

  6. Click the Play Animation button (or press the / key) to see the animation play.

Tip

Another way to accomplish this same motion is to create a spline of a figure eight and use the Path constraint.

Figure 21.5 shows the skater as she makes her path around the two dummy objects.

With the Link constraint, the figure skater can move in a figure eight by rotating about two dummy objects.

Figure 21.5. With the Link constraint, the figure skater can move in a figure eight by rotating about two dummy objects.

LookAt constraint

The LookAt constraint won't move an object, but it rotates the object so it is always orientated toward the target object. For example, you could use the LookAt constraint to animate a character's head that is watching a flying bumblebee. It is also very useful to apply to camera objects that follow a specific object throughout the animation.

After you select a target object, a single line extends from the object and points at the target object. This line, called the Viewline, is visible only within the viewports.

The LookAt Constraint rollout, like many of the other constraints, includes a list of targets. With the Add and Delete LookAt Target buttons, you can add and remove targets from the list. If several targets are on the list, the object is centered on a location between them. Using the Weight value, you can cause the various targets to have more of an influence over the orientation of the object. The Keep Initial Offset option prevents the object from reorienting itself when the constraint is applied. Any movement is relative to its original position.

You can set the Viewline length, which is the distance that the Viewline extends from the object. The Viewline Length Absolute option draws the Viewline from the object to its target, ignoring the length value.

The Set Orientation button lets you change the offset orientation of the object using the Select and Rotation button on the main toolbar. If you get lost, the Reset Orientation button returns the orientation to its original position. You can select which local axis points at the target object.

The Upnode is an object that defines the up direction. If the LookAt axis ever lines up with the Upnode axis, then the object flips upside-down. To prevent this, you can select which local axis is used as the LookAt axis and which axis points at the Upnode. The World is the default Upnode object, but you can select any object as the Upnode object by deselecting the World object and clicking the button to its right.

To control the Upnode, you can select the LookAt option or the Axis Alignment option, which enables the Align to Upnode Axis option. Using this option, you can specify which axis points toward the Upnode.

Warning

The object using the LookAt constraint flips when the target point is positioned directly above or below the object's pivot point.

When you assign the LookAt constraint, the Create Key button for rotation changes to Roll. This is because the camera is locked to point at the assigned object and cannot rotate; rather, it can only roll about the axis.

You can use the LookAt constraint to let cameras follow objects as they move around a scene. It is the default transform controller for Target camera objects.

Orientation constraint

You can use the Orientation constraint to lock the rotation of an object to another object. You can move and scale the objects independently, but the constrained object rotates along with the target object. A good example of an animation that uses this type of constraint is a satellite that orbits the Earth. You can offset the satellite and still constrain it to the Earth's surface. Then, as the Earth moves, the satellite follows.

In the Orientation Constraint rollout, you can select several orientation targets and weight them in the same manner as with the Position constraint. The target with the greatest weight value has the most influence over the object's orientation. You can also constrain an object to the World object. The Keep Initial Offset option maintains the object's original orientation and rotates it relative to this original orientation. The Transform Rule setting determines whether the object rotates using the Local or World Coordinate Systems.

Using the Walkthrough Assistant

One alternative to using the Path and Look At constraint is to use the Walkthrough Assistant. This tool is accessed from the Animation menu. It opens up a utility panel with several rollouts, as shown in Figure 21.6. Using this panel, you can create a new camera, select a path, and set the viewport to use the created camera. You can then use the View Controls rollout to cause the view to tilt to the left or right as you move through the path. This automates the process of getting a camera to follow a path.

Note

The Walkthrough Assistant is new to 3ds Max 2009.

The Walkthrough Assistant also includes a Render Preview that you use to see the results. If you drag the Time Slider to a different frame and click on the Render Preview pane, the preview is updated. At specific frames, you can drag the Turn Head slider to change where the camera is looking. You can even tilt the camera up and down as well as side to side.

In the Advanced Controls rollout are options for changing the Field of View and the Target Distance, which is useful if you're using a Depth of Field effect. You can also set the camera to move at a constant speed and an option to cause the camera to follow the path.

The Walkthrough Assistant automates several constraints into a single interface.

Figure 21.6. The Walkthrough Assistant automates several constraints into a single interface.

Understanding Controller Types

Controllers are used to set the keys for animation sequences. Every object and parameter that is animated has a controller assigned, and almost every controller has parameters that you can alter to change its functionality. Some controllers present these parameters as rollouts in the Motion panel, and others use a Properties dialog box.

Max has five basic controller types that work with only a single parameter or track and one specialized controller type that manages several tracks at once (the Transform controllers). The type depends on the type of values the controller works with. The types include the following:

  • Transform controllers: A special controller type that applies to all transforms (position, rotation, and scale) at the same time, such as the Position, Rotation, Scale (PRS) controllers

  • Position controllers: Control the position coordinates for objects, consisting of X, Y, and Z values

  • Rotation controllers: Control the rotation values for objects along all three axes

  • Scale controllers: Control the scale values for objects as percentages for each axis

  • Float controllers: Used for all parameters with a single numeric value, such as Wind Strength and Sphere Radius

  • Point3 controllers: Consist of color components for red, green, and blue, such as Diffuse and Background colors

Note

Understanding the different controller types is important. When you copy and paste controller parameters between different tracks, both tracks must have the same controller type.

Float controllers work with parameters that use float numbers, such as a sphere's Radius or a plane object's Scale Multiplier value. Float values are numbers with a decimal value, such as 2.3 or 10.99. A Float controller is assigned to any parameter that is animated. After it is assigned, you can access the function curves and keys for this controller in the Track View and in the Track Bar.

Assigning Controllers

Any object or parameter that is animated is automatically assigned a controller. The controller that is assigned is the default controller. The Animation panel in the Preference Settings dialog box lists the default controllers and lets you change them. You can change this automatic default controller using the Track View window or the transformation tracks located in the Motion panel.

Automatically assigned controllers

The default controllers are automatically assigned for an object's transformation tracks when the object is created. For example, if you create a simple sphere and then open the Motion panel (which has the icon that looks like a wheel), you can find the transformation tracks in the Assign Controller rollout. The default Position controller is Position XYZ, the default Rotation controller is Euler XYZ, and the default Scale controller is the Bézier Scale controller.

The default controller depends on the type of object. For example, the Barycentric Morph controller is automatically assigned when you create a morph compound object, and the Master Point controller is automatically assigned to any vertices or control points subobjects that are animated.

Note

Because controllers are automatically assigned to animation tracks, they cannot be removed; they can only be changed to a different controller. There is no function to delete controllers.

Assigning controllers with the Animation menu

The easiest way to assign a controller to an object is with the Animation menu. Located under the Animation menu are four controller submenus consisting of Transform, Position, Rotation, and Scale.

Note

Although constraints are contained within a separate menu, they control the animating of keys just like controllers.

When a controller is assigned to an object using the Animation menu, the existing controller is not removed, but the new controller is added as part of a list along with the other controllers. You can see all these controllers in the Motion panel.

For example, Figure 21.7 shows the Motion panel for a sphere object that has the default Position XYZ controller assigned to the Position track. If you choose Animation

Assigning controllers with the Animation menu
The Motion panel displays all transform controllers applied to an object.

Figure 21.7. The Motion panel displays all transform controllers applied to an object.

The List controller allows you to set Weights for each of its controllers. Using the Position List rollout, you can set the active controller and delete controllers from the list. You can also Cut and Paste controllers to other tracks.

Assigning controllers in the Motion panel

The top of the Motion panel includes two buttons: Parameters and Trajectories. Clicking the Parameters button makes the Assign Controller rollout available.

Assigning controllers in the Motion panel

Note

For more about the Trajectories button, see Chapter 20, "Understanding Animation and Keyframe Basics."

For example, Figure 21.8 shows the Assign Position Controller dialog box for selecting a controller for the Position track. The arrow mark (>) shows the current selected controller. At the bottom of the dialog box, the default controller type is listed. Select a new controller from the list, and click OK. This new controller now is listed in the track, and the controller's rollouts appear beneath the Assign Controller rollout.

The Assign Position Controller dialog box lets you select a controller to assign.

Figure 21.8. The Assign Position Controller dialog box lets you select a controller to assign.

Note

Transformation controllers can be applied in the Motion panel, but the Track View can be used to apply controllers to all parameters including transforms.

Assigning controllers in the Track View

Assigning controllers in the Track View

Note

Chapter 34, "Working with Function Curves in the Track View," covers the details of the Track View.

You can also use the Controller toolbar to copy and paste controllers between tracks, but you can paste controllers only to similar types of tracks. When you paste controllers, the Paste dialog box lets you choose to paste the controller as a copy or as an instance. Changing an instanced controller's parameters changes the parameters for all instances. The Paste dialog box also includes an option to replace all instances. This option replaces all instances of the controller, whether or not they are selected.

Setting Default Controllers

When you assign controllers using the Track View, the Assign Controller dialog box includes the option Make Default. With this option, the selected controller becomes the default for the selected track.

You can also set the global default controller for each type of track by choosing Customize

Setting Default Controllers

Note

Changing a default controller does not change any currently assigned controllers.

Examining the Various Controllers

Now that you've learned how to assign controllers, let's look at the available controllers. Max includes a vast assortment of controllers, and you can add more controllers as plug-ins.

Earlier in the chapter, I mentioned six specific controller types. These types define the type of data that the controller works with. This section covers the various controllers according to the types of tracks with which they work.

Note

Looking at the function curves for a controller provides a good idea of how you can control it, so many of the figures that follow show the various function curves for the different controllers.

Each of these controllers has a unique icon to represent it in the Track View. This makes them easy to identify.

Transform controllers

Multi-track transform controllers work with the Position, Rotation, and Scale tracks all at the same time. You access them by selecting the Transform track in the Motion panel and then clicking the Assign Controller button, or by choosing the Animation

Transform controllers

Note

Each of the available constraints is listed again in the appropriate controller submenu.

Position/Rotation/Scale Transform controller

Position/Rotation/Scale Transform controller

The PRS Parameters rollout, shown in Figure 21.9, lets you create and delete keys for Position, Rotation, and Scale transforms. The Position, Rotation, and Scale buttons control the fields that appear in the Key Info rollouts positioned below the PRS Parameters rollout.

The PRS Parameters rollout is the default transform controller.

Figure 21.9. The PRS Parameters rollout is the default transform controller.

Script controller

Script controller

Note

For more information on MAXScript, see Chapter 49, "Automating with MAXScript."

XRef controller

If you have a defined motion used by an object in another file that you want to access, you can use the XRef controller. This controller can only be assigned to the Transform track. When this controller is assigned, a file dialog box opens where you can select the XRef file; then in the Merge Object dialog box, you can select a specific object that has the controller and motion you want to use.

XRef controller

Note

XRefs are covered in detail in Chapter 3, "Working with Files, Importing, and Exporting."

Position track controllers

Position track controller types include some of the common default controllers and can be assigned to the Position track. They typically work with three unique values representing the X-, Y-, and Z-axes. These controllers can be assigned from the Animation

Position track controllers

Audio controller

Audio controller

The Real Time Control drop-down list lets you specify a device to control the system. To control the sound input, you can specify a Sample Threshold and Oversampling rate. You can also set Base Point and Target Point values for each axis. The Channel options let you specify which channel to use: Left, Right, or Mix.

The Audio Controller dialog box lets you change values based on the amplitude of a sound file.

Figure 21.10. The Audio Controller dialog box lets you change values based on the amplitude of a sound file.

Bézier controller

Bézier controller

The Bézier controller parameters are displayed in the Motion panel under two rollouts: Key Info (Basic) and Key Info (Advanced).

At the top of the Key Info (Basic) rollout are two arrows and a field that shows the key number. The arrows let you move between the Previous and Next keys. Each vertex shown in the function curve represents a key. The Time field displays the frame number where the key is located. The Time Lock button next to the Time field can be set to prevent the key from being dragged in Track View. The value fields show the values for the selected track; the number of fields changes depending on the type of track that is selected.

At the bottom of the Key Info (Basic) rollout are two flyout buttons for specifying the In and Out curves for the key. The arrows to the sides of these buttons move between the various In/Out curve types. The curve types include Smooth, Linear, Step, Slow, Fast, Custom, and Tangent Copy.

The Bézier controller produces smooth animation curves.

Figure 21.11. The Bézier controller produces smooth animation curves.

Note

Chapter 34, "Working with Function Curves in the Track View," describes these various In/Out curve types.

The In and Out values in the Key Info (Advanced) rollout are enabled only when the Custom curve type is selected. These fields let you define the rate applied to each axis of the curve. The Lock button changes the two values by equal and opposite amounts. The Normalize Time button averages the positions of all keys. The Constant Velocity option interpolates the key between its neighboring keys to provide smoother motion.

Linear controller

Linear controller

The Linear controller doesn't include any parameters and can be applied to time or values. Figure 21.12 shows the curves from the previous example after the Linear controller is assigned—all curves have been replaced with straight lines.

The Linear controller uses straight lines.

Figure 21.12. The Linear controller uses straight lines.

Motion Clip Slave controller

The Motion Clip Slave controller lets a linked motion clip that is loaded and defined in the Motion Mixer control the object's transform.

Note

The Motion Mixer and using Motion Clips are covered in Chapter 35, "Using Animation Layers and the Motion Mixer."

Noise controller

Noise controller
The Noise controller properties let you set the noise strength for each axis.

Figure 21.13. The Noise controller properties let you set the noise strength for each axis.

You also have an option to enable Fractal Noise with a Roughness setting.

The Ramp in and Ramp out values determine the length of time before or until the noise can reach full value. The Characteristic Graph gives a visual look at the noise over the range. Figure 21.14 shows the Noise controller assigned to the Position track. If you need to change any Noise properties, right-click the Noise track and select Properties from the pop-up menu.

The Noise controller lets you randomly alter track values.

Figure 21.14. The Noise controller lets you randomly alter track values.

Motion Capture controller

Motion Capture controller

After you assign the Motion Capture controller to a track, right-click the track and select Properties from the pop-up menu to open the Motion Capture panel, shown in Figure 21.15. This dialog box lets you select the devices to use to control the motion of the track values. Options include Keyboard, Mouse, Joystick, and MIDI devices.

The Motion Capture controller lets you control track values using external devices.

Figure 21.15. The Motion Capture controller lets you control track values using external devices.

For the Keyboard control, the Keyboard Input Device rollout appears, as shown in Figure 21.16. The Assign button lets you select a keyboard key to track. The other settings control the Envelope Graph, which defines how quickly key presses are tracked.

The Keyboard Input Device rollout lets you select which key press is captured.

Figure 21.16. The Keyboard Input Device rollout lets you select which key press is captured.

The Motion Capture dialog box defines only which device controls which values. The actual capturing of data is accomplished using the Motion Capture utility. Selecting the Motion Capture utility in the Utility panel displays the Motion Capture rollout. This rollout includes buttons to Start, Stop, and Test the data-capturing process.

Before you can use the Start, Stop, and Test buttons, you need to select the tracks to capture from the Tracks list. The Record Range section lets you set the Preroll, In, and Out values, which are the frame numbers to include. You can also set the number of Samples Per Frame. The Reduce Keys option removes any unnecessary keys, if enabled.

Tutorial: Drawing with a pencil with the Motion Capture controller

Some motions, such as drawing with a pencil, are natural motions for our hands, but they become very difficult when you're trying to animate using keyframes. This tutorial uses the Motion Capture controller and utility to animate the natural motion of drawing with a pencil.

To animate a pencil drawing on paper, follow these steps:

  1. Open the Drawing with a pencil.max file from the Chap 21 directory on the DVD.

    This file has a pencil object positioned on a piece of paper.

  2. Select the pencil object, open the Motion panel, and select the Position track for the pencil object. Then click the Assign Controller button, and double-click the Position Motion Capture selection.

    The Motion Capture dialog box opens.

  3. Click the X Position button, and double-click the Mouse Input Device selection. Then click the Y Position button, and double-click the Mouse Input Device selection again. In the Mouse Input Device rollout, select the Vertical option. This sets the X Position to the Horizontal Mouse movement and the Y Position to the Vertical Mouse movement. Close the Motion Capture dialog box.

  4. Open the Utilities panel, and click the Motion Capture button. In the Motion Capture rollout, select the Position track, and get the mouse ready to move. Then click the Start button in the Record Controls section, and move the mouse as if you were drawing with the mouse. The pencil object moves in the viewport along with your mouse movements.

    The Motion Capture utility creates a key for each frame. It quits capturing the motion when it reaches frame 100.

  5. Click the Play Animation button (or press the / key) to see the results.

Figure 21.17 shows the scene after the Motion Capture controller has computed all the frames.

Quaternion (TCB) controller

Quaternion (TCB) controller

The parameters for this controller are displayed in a single Key Info rollout. Like the Bézier controller rollouts, the Quaternion (TCB) controller rollout includes arrows and Key, Time, and Value fields. It also includes a graph of the TCB values; the red plus sign represents the current key's position, while the rest of the graph shows the regular increments of time as black plus signs. Changing the Tension, Continuity, and Bias values in the fields below the graph changes its shape. Right-clicking the track and selecting Properties from the pop-up menu opens the TCB graph dialog box, shown in Figure 21.18.

The Motion Capture controller and utility let you animate with a mouse, keyboard, joystick, or MIDI device.

Figure 21.17. The Motion Capture controller and utility let you animate with a mouse, keyboard, joystick, or MIDI device.

This dialog box shows, and lets you control, a curve defined by the Tension, Continuity, and Bias values.

Figure 21.18. This dialog box shows, and lets you control, a curve defined by the Tension, Continuity, and Bias values.

The Tension value controls the amount of curvature: High Tension values produce a straight line leading into and away from the key, and low Tension values produce a round curve. The Continuity value controls how continuous, or smooth, the curve is around the key: The default value of 25 produces the smoothest curves, whereas high and low Continuity values produce sharp peaks from the top or bottom. The Bias value controls how the curve comes into and leaves the key point, with high Bias values causing a bump to the right of the key and low Bias values causing a bump to the left.

The Ease To and Ease From values control how quickly the key is approached or left.

Note

Enabling the trajectory path by clicking the Trajectory button in the Motion panel lets you see the changes to the path as they are made in the Key Info rollout.

The TCB controller offers a different way to work with curves.

Figure 21.19. The TCB controller offers a different way to work with curves.

Figure 21.19 shows three TCB curves assigned to the Position track of an object.

Reaction controller

Reaction controller

Note

Don't confuse the Reaction controller with the reactor plug-in, which computes motion based on physical dynamics. The reactor plug-in is covered in Chapter 38, "Simulating Physics-Based Motion with reactor."

After the Reaction controller is assigned to a track, you can define the reactions using the Reaction Manager dialog box, shown in Figure 21.20. Selecting and right-clicking the track with this controller assigned and selecting Properties from the pop-up menu opens this dialog box. You can also open the Reaction Manager dialog box using the Animation

Reaction controller

The Reaction Manager is made up of two lists and a graph of function curves. The top list holds all the object values that are involved in reactions. These are listed in a hierarchy with the master object listed above the slave object. A single master object can control several slave parameters.

The buttons above the Reactions list let you add new masters, slaves, and selected objects to the list. The cursor changes after you click any of these buttons, allowing you to click an object in the viewport and select a value from a pop-up menu.

For the slave objects selected in the Reactions list, you can set states using the buttons above the States list. To set a state, click the Create Mode button, drag the Time Slider to appropriate frame, and change the slave object's value. Then click the Add State button to create the target object state. Several unique states can be defined for each slave object.

State values can be changed by accessing the Edit Mode button or by editing the curves displayed at the bottom of the Reaction Manager dialog box.

The Reaction Manager dialog box lets you set the parameters of a reaction.

Figure 21.20. The Reaction Manager dialog box lets you set the parameters of a reaction.

Spring controller

Spring controller

In the Spring Dynamics rollout, you can change the Mass and Drag values. Higher mass values result in greater secondary motion as the object is moved, and the Drag value controls how quickly the bouncing motion stops. You can add multiple springs, each with its own Tension and Damping values to be applied Relative or Absolute.

The Forces, Limits, and Precision rollout lets you add forces that affect the spring motion. The Add button lets you identify these forces, which are typically Space Warps, and you can limit the effect to specific axes.

The Spring controller rollouts can add additional springs and forces.

Figure 21.21. The Spring controller rollouts can add additional springs and forces.

Tutorial: Wagging a tail with the Spring controller

One of the best uses of the Spring controller is to gain the secondary motion associated with an existing motion. For example, if a character moves, then an appendage such as a tail can easily follow if you apply a Spring controller to it.

To wag a row of spheres using the Spring controller, follow these steps:

  1. Open the Dog wagging tail.max file from the Chap 21 directory on the DVD.

    This file contains a linked row of spheres with the head sphere animated rotating back and forth.

  2. Select the smallest sphere, and choose the Animation

    Tutorial: Wagging a tail with the Spring controller
  3. Repeat Step 2 for the remaining spheres, moving from smallest to largest.

  4. Click the Play Animation button (or press the / key) to see the resulting motion.

Figure 21.22 shows a frame of the final motion. Notice that the spheres aren't lined up exactly. The smallest sphere is moving the greatest distance because all the springs are adding their effect.

The Spring controller adds secondary motion to the existing motion of the largest sphere.

Figure 21.22. The Spring controller adds secondary motion to the existing motion of the largest sphere.

Position XYZ controller

Position XYZ controller

The Rotation tracks use a variety of controllers, many of them common to the Position track. This section lists the controllers that can be used only with the Rotation track.

Rotation and Scale track controllers

The Rotation and Scale track controller types include some of the common default controllers and can be assigned to the Rotation and Scale tracks. They typically work with three unique values representing the X-, Y-, and Z-axes. These controllers can be assigned from the Animation

Rotation and Scale track controllers

Euler XYZ Rotation controller

Euler XYZ Rotation controller

The main difference is that Euler rotation gives you access to the function curves. Using these curves, you can smoothly define the rotation motion of the object.

Note

Euler XYZ Rotation values are in radians instead of degrees. If using these as part of an expression, be sure to use radians and not degrees. Radians are much smaller values than degrees. A full revolution is 360 degrees or 2 times Pi radians, so one degree equals about 0.0174 radians.

The Euler Parameters rollout lets you choose the Axis Order, which is the order in which the axes are calculated. You can also choose which axis to work with.

Warning

The Euler XYZ controller is susceptible to Gimbal lock, which occurs when two of the three axes align to each other, causing the object to lose a degree of freedom. This can be minimized by making the axis that rotates the least the middle axis. You also can use the Euler Filter utility in the Track View to avoid Gimbal lock or you can use the Quaternion controller instead.

Smooth Rotation controller

Smooth Rotation controller

Scale XYZ controller

Scale XYZ controller

The Scale XYZ Parameters rollout lets you select which axis to work with. This controller works the same way as the other position and rotation XYZ controllers.

Parameter controllers

Other controllers are used to affect the animated changes of parameters whether they are float, point3, or other parameter types. Many of these controllers combine several controllers into one, such as the List and Block controllers. Others include separate interfaces, such as the Waveform controller for defining the controller's functions.

Most of these special-purpose controllers can be assigned only by using the Track View window. The Motion panel contains only the tracks for transformations.

Boolean controller

Boolean controller

Limit controller

Limit controller
The Limit controller dialog box lets you set upper and lower limits for the current controller value.

Figure 21.23. The Limit controller dialog box lets you set upper and lower limits for the current controller value.

The upper limit is the maximum value to which the controller can be set, and the lower limit is the minimum value that the controller uses. Controller values may exceed the upper and lower limit values, but the object's motion stops at the limit values when the Limit controller is enabled. The Smoothing Buffer value provides a range that gradually alters the value as it approaches the limit value.

After a Limit controller is applied to an object, you can quickly change its upper and lower limit values by right-clicking the object in the Track View and accessing the Limit Controller option in the quadmenu.

Tip

You can disable all limits at once using the Animation

The Limit controller dialog box lets you set upper and lower limits for the current controller value.

List controller

List controller

When the List controller is applied, the default track appears as a subtrack along with another subtrack labeled Available. By selecting the Available subtrack and clicking the Assign Controller button, you can assign additional controllers to the current track.

All subtrack controllers are included in the List rollout of the Motion panel. You also can access this list by right-clicking the track and selecting Properties from the pop-up menu. The order of the list is important because it defines which controllers are computed first.

The Set Active button lets you specify which controller you can interactively control in the viewport; the active controller is marked with an arrow, which is displayed to the left of the name. You also can cut and paste controllers from and to the list. Because you can use the same controller type multiple times, you can distinguish each one by entering a name in the Name field.

On/Off controller

On/Off controller

Note

You can also add a Visibility track by changing the Visibility value in the Object Properties dialog box.

The On/Off controller lets you make objects appear and disappear.

Figure 21.24. The On/Off controller lets you make objects appear and disappear.

Waveform controller

Waveform controller

When you select a waveform in the list, you can give it a name and edit its shape using the buttons and values. Preset waveform shapes include Sine, Square, Triangle, Sawtooth, and Half Sine. You can also invert and flip these shapes.

The Waveform Controller dialog box lets you produce sinusoidal motions.

Figure 21.25. The Waveform Controller dialog box lets you produce sinusoidal motions.

The Period value defines the number of frames required to complete one full pattern. The Amplitude value sets the height of the wave, and the Phase value determines its location at the start of the cycle. The Duty Cycle value is used only for the square wave to define how long it stays enabled.

You can use the Vertical Bias options to set the values range for the waveform. Options include Centered, which sets the center of the waveform at 0; Auto > 0, which causes all values to be positive; Auto < 0, which causes all values to be negative; and Manual, which lets you set a value for the center of the waveform.

The Effect option determines how different waveforms in the list are combined. They can be added, multiplied, clamped above, or clamped below. The Add option simply adds the waveform values together, and the Multiply option multiplies the separate values. The Clamp Above and Clamp Below options force the values of one curve to its maximum or minimum while not exceeding the values of the other curve. The Characteristic Graph shows the selected waveform, the output, or the final resulting curve. Figure 21.26 shows the Characteristic Graph for each Effect option when a sine wave and a square wave are combined.

Combining sine and square waves with the Add, Multiply, Clamp Above, and Clamp Below Effect options.

Figure 21.26. Combining sine and square waves with the Add, Multiply, Clamp Above, and Clamp Below Effect options.

Color RGB controller

Color RGB controller

The Color RGB controller splits a track with color information into its component RGB tracks. You can use this controller to apply a different controller to each color component and also to animate any color swatch in Max.

Figure 21.27 shows the function curves for the Color RGB controller assigned to the Diffuse Color track under the Material #1 track, including subtracks for Red, Green, and Blue. The figure shows the Bézier controller applied to the Red track, the Noise controller that is assigned to the Green track, and the Waveform controller with a triangle wave applied to the Blue track.

The Color RGB controller lets you assign different controllers to each color component.

Figure 21.27. The Color RGB controller lets you assign different controllers to each color component.

Cubic Morph controller

You can assign the Cubic Morph controller to a morph compound object. You can find the track for this object under the Objects track. A subtrack of the morph object is the Morph track, which holds the morph keys.

The Cubic Morph controller uses Tension, Continuity, and Bias values to control how targets blend with one another. You can access these TCB values in the Key Info dialog box by right-clicking any morph key or by right-clicking the Morph track and selecting Properties from the pop-up menu.

Note

You can also access the TCB values by right-clicking the keys in the Track Bar.

Barycentric Morph controller

The Barycentric Morph controller is automatically applied when a morph compound object is created. Keys are created for this controller based on the morph targets set in the Modify panel under the Current Targets rollout for the morph compound object. You can edit these keys using the Barycentric controller Key Info dialog box, which you can open by right-clicking a morph key in the Track View or in the Track Bar.

The main difference between the Cubic Morph controller and the Barycentric Morph controller is that the latter can have weights applied to the various morph keys.

The Barycentric Morph controller Key Info dialog box includes a list of morph targets. If a target is selected, its Percentage value sets the influence of the target. The Time value is the frame where this key is located. The TCB values and displayed curve control the Tension, Continuity, and Bias parameters for this controller. The Constrain to 100% option causes all weights to equal 100 percent; changing one value changes the other values proportionally if this option is selected.

Block controller

Block controller

To add a Block controller, select the Available track under the Block Control track under the Global Tracks track, and click the Assign Controller button. From the Assign Constant Controller dialog box that opens, select Master Block and click OK. Right-click the Master Block track and select Properties to open the Master Block Parameters dialog box, shown in Figure 21.28.

The Master Block Parameters dialog box lists all the tracks applied to a Block controller.

Figure 21.28. The Master Block Parameters dialog box lists all the tracks applied to a Block controller.

In the Master Block Parameters dialog box, you can add a track to the Block controller with the Add button. All tracks added are displayed in the list on the left. You can give each track a name by using the Name field. You can also use the Add Selected button to add any selected tracks. The Replace button lets you select a new controller to replace the currently selected track. The Load and Save buttons enable you to load or save blocks as separate files.

The Add button opens the Track View Pick dialog box, shown in Figure 21.29. This dialog box displays all valid tracks in a darker color to make them easier to see, while graying out invalid tracks.

The Track View Pick dialog box lets you select the tracks you want to include in the Block controller.

Figure 21.29. The Track View Pick dialog box lets you select the tracks you want to include in the Block controller.

Select the tracks that you want to include, and click OK. The Block Parameters dialog box opens, shown in Figure 21.30, in which you can name the block, specify Start and End frames, and choose a color. Click OK when you've finished with this dialog box.

The Block Parameters dialog box lets you name a block.

Figure 21.30. The Block Parameters dialog box lets you name a block.

Back in the Master Block Parameters dialog box, click the Load button to open a file dialog box where you can load a saved block of animation parameters. The saved block files have the .blk extension. After the parameters have loaded, the Attach Controls dialog box opens, as shown in Figure 21.31. This dialog box includes two panes. The Incoming Controls pane on the left lists all motions in the saved block. By clicking the Add button, you can add tracks from the current scene, to which you can copy the saved block motions.

Because the saved motions in the Incoming Controls pane will match up with the Copy to entries in the right pane, the Add Null button adds a space in place of a specific track if you don't want a motion to be copied. The Match by Node button matches tracks by means of the Track View Pick dialog box.

The Attach Controls dialog box lets you attach saved tracks to the Block controller.

Figure 21.31. The Attach Controls dialog box lets you attach saved tracks to the Block controller.

IK controller

The IK controller works on a bones system for controlling the bone objects of an IK (inverse kinematics) system. The IK controller includes many different rollouts for defining joint constraints and other parameters.

Note

Find out more about the IK controller in Chapter 40, "Understanding Rigging and Working with Bones."

Master Point controller

Master Point controller

Right-clicking a green master key opens the Master Track Key Info dialog box, shown in Figure 21.32. This dialog box shows the Key number with arrows for selecting the previous or next key, a Time field that displays the current frame number, and a list of all the vertices. Selecting a vertex from the list displays its parameters at the bottom of the dialog box.

The Master Track Key Info dialog box lets you change the key values for each vertex.

Figure 21.32. The Master Track Key Info dialog box lets you change the key values for each vertex.

Figure 21.33 shows the Master Point controller that was automatically assigned when a selection of vertex subobjects was moved with the Auto Key button enabled. A separate track is created for each vertex.

The Master Point controller defines tracks for each subobject element that is animated.

Figure 21.33. The Master Point controller defines tracks for each subobject element that is animated.

Summary

Using the Animation

Summary

This chapter covered the basics of using the Expression controller. Using mathematical formulas to control the animation of an object's transformation and parameters offers lots of power. You can also use the values of one object to control another object.

In this chapter, you accomplished the following:

  • Constrained an object to the surface of another object using the Attachment and Surface constraints

  • Forced an object to travel along a path with the Path constraint

  • Controlled the position and orientation of objects with weighted Position and Orientation constraints

  • Shifted between two different controlling objects using the Link constraint

  • Followed objects with the LookAt constraint

  • Learned about the various controller types

  • Discovered how to assign controllers using the Motion panel and the Track View

  • Set default controllers in the Preference Settings dialog box

  • Examined the various controllers in several different categories

  • Saw a few examples of using controllers

In the next chapter, you learn to final render a scene so you can have some output to hang on Mom's fridge.

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

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