Online Book Reader

Home Category

3ds Max 2012 Bible - Kelly L. Murdock [384]

By Root 1755 0
in a spinner by typing the letter R and a value. For example, if the Segments value of a sphere object is 32, then typing R20 changes the value to 52, and R-20 changes the value to 12. •

Understanding the Expression Controller Interface

The term expression refers to a mathematical expression or simple formula that computes a value based on other values. These expressions can be simple, as with moving a bicycle based on the rotation of the pedals, or they can be complex, as with computing the sinusoidal translation of a boat on the sea as a function of the waves beneath it.

You can use almost any value as a variable in an expression, from object coordinates and modifier parameters to light and material settings. The results of the expression are computed for every frame and used to affect various parameters in the scene. You can include the number of frames and time variables in the expression to cause the animation results to repeat for the entire sequence.

Note

Although it is not as powerful as the Script controller, the Expression controller is much faster than the Script controller because it doesn't require any compile time. •

Of all the controllers that are available, the Expression controller has limitless possibilities that could fill an entire book. This section covers the basics of building expressions and includes several examples.

The Expression controller is just one of the many controllers that are available for automating animations. This controller enables you to define how the object is transformed by means of a mathematical formula or expression, which you can apply to any of the object's tracks. It shows up in the controller list, based on the type of track to which it is assigned, as a Position Expression, Rotation Expression, Scale Expression, Float Expression, or Point3 Expression controller.

Before you can use the Expression controller on a track, you must assign it to a track. You can assign controllers to the Position, Rotation, and Scale tracks using the Motion panel or the Track View or you can apply a controller by right-clicking on a track in the Track View and selecting the Assign Controller option. After you assign a controller, the Expression Controller dialog box immediately opens, or you can access this dialog box at any time by right-clicking the track and selecting Properties from the pop-up menu. For example, select an object in your scene, open the Motion panel, and select the Position track. Then click the Assign Controller button at the top of the Assign Controller rollout, and select Position Expression from the list of Controllers. This causes the Expression Controller dialog box to appear.

You can use this dialog box to define variables and write expressions. The dialog box, shown in Figure 36.2, includes four separate panes used to display a list of Scalar and Vector variables, build an expression, and enter a description of the expression.

FIGURE 36.2

You can use the Expression controller to build expressions and define their results.

Defining variables

Variables are placeholders for different values. For example, creating a variable for a sphere's radius called “r” would simplify an expression for doubling its size from “take the sphere's radius and multiply it by two,” to simply “r times 2.”

To add variables to the list panes in the Expression Controller dialog box, type a name in the Name field, select the Scalar or Vector option type, and click the Create button; the new variable appears in the Scalars or Vectors list. To delete a variable, select it from the list and click the Delete button. The Tick Offset value is the time added to the current time and can be used to delay variables.

You can assign any new variable either to a constant or to a controller. Assigning a variable to a constant does the same thing as typing the constant's value in the expression. Constant variables are simply for convenience in writing expressions. The Assign to Controller button opens the Track View Pick dialog box, shown in Figure 36.3, where you can select the specific

Return Main Page Previous Page Next Page

®Online Book Reader