Wiring Parameters


When parameters are wired together, the value of one parameter controls the value of the parameter to which it is wired. This is a powerful animation technique that lets a change in one part of the scene control another aspect of the scene. Another way to use wired parameters is to create custom animation controls such as a slider that dims a light source that animators can use as needed.

Using the Parameter Wiring dialog box

You can access the Parameter Wiring dialog box in several places. The Animation image from book Wire Parameters image from book Wire Parameters (Ctrl+5) menu makes a pop-up menu of parameters appear. Selecting a parameter from the menu changes the cursor to a dotted line (like the one used when linking objects). Click the object that you want to wire to, and another pop-up menu lets you choose the parameter to wire to. The Parameter Wiring dialog box appears with the parameter for each object selected from a hierarchy tree.

You can also wire parameters by right-clicking the and selecting Wire Parameters. The Wire Parameters option is disabled if multiple objects are selected.

The Parameter Wiring dialog box (Alt+5), shown in Figure 31.10, displays two tree lists containing all the available parameters. This tree list looks very similar to the Track View and lets you connect parameters in either direction or to each other. If you used the Wire Parameters feature to open the Parameter Wiring dialog box, then the parameter for each object is already selected and highlighted in yellow.

image from book
Figure 31.10: The Parameter Wiring dialog box can work with expressions.

The three arrow buttons between the two tree lists let you specify the connection direction. These buttons connect the parameter in one pane to the selected parameter in the opposite pane. The direction determines whether the parameter in the left pane controls the parameter in the right pane, or vice versa. You can also select the top bidirectional button to make the parameters mutually affect each other. Below each tree list is a text area where you can enter an expression. An expression is a mathematical statement that follows a specific syntax for defining how one parameter controls the other. These expressions can be any valid expression that is accepted in the Animation Controller dialog box or in MAXScript.

CROSS-REF 

You can learn more about creating and using expressions in Chapter 32, "Animating with Constraints and Controllers."

After an expression is entered, click the Connect button to complete the wiring. Based on the connection direction, the Master radio button indicates which object controls the other. You can also use this dialog box to disconnect existing wired parameters. You can use the two icon buttons at the top of the dialog box, shown in Table 31.1, to Show All Tracks and to find the next wired parameter.

Table 31.1: Parameter Wiring Dialog Box Icons
Open table as spreadsheet

Button

Description

image from book

Show All Tracks

image from book

Next Wired Parameter

After the wiring is completed, the Parameter Wiring dialog box remains open. You can try out the wiring by moving the master object. If the results aren't what you wanted, you can edit the expression and click the Update button (the Connect button changes to an Update button).

If the expression contains an error, the track title is displayed in red and an error dialog box appears, telling you what the error is. You need to correct the error and click the Update button before the wiring will be in effect. If the wiring is successful, then the track title is displayed in green.

Manipulator helpers

To create general-use controls that can be wired to control various properties, Max includes three Manipulator Helpers. These helpers are Cone Angle, Plane Angle, and Slider. They are available as a subcategory under the Helpers category of the Create panel or in the Create image from book Helpers image from book Manipulators menu.

For the Cone Angle helper, you can set the Angle, Distance, and Aspect settings. The default cone is a circle, but you can make it a square. The Plane Angle helper includes settings for Angle, Distance, and Size.

You can name the Slider helper. This name appears in the viewports above the slider object. You can also set a default value along with maximum and minimum values. To position the object, you can set the X Position, Y Position, and Width settings. You can also set a snap value for the slider.

Once created, you can use these manipulator helpers when the Select and Manipulate button on the main toolbar is enabled (this button must be disabled before the manipulator helpers can be created). The advantage of these helpers is in wiring parameters to be controlled using the helpers.

Tutorial: Controlling a crocodile's bite

One way to use manipulator helpers and wired parameters is to control within limits certain parameters that can be animated. This gives your animation team controls they can use to quickly build animation sequences. In this example, you use a slider to control a crocodile's jaw movement.

To create a slider to control a crocodile's bite, follow these steps:

  1. Open the image from book Biting crocodile.max file from the Chap 31 directory on the DVD.

    This file includes a crocodile model created by Viewpoint Datalabs. For this model, the head, eyes, and upper teeth have been joined into a single object, and the pivot point for this object has been moved to where the jaw hinges.

  2. Select Create image from book Helpers image from book Manipulators image from book Slider, and click in the Perspective view above the crocodile. Name the slider Croc Bite, and set the Maximum value to 60.

  3. With the Slider selected, choose Animation image from book Wire Parameter image from book Wire Parameter (or press the Ctrl+5) to access the pop-up menu. Choose Object (Slider) image from book value option, drag the dotted line to the crocodile's head object, and click. Choose Transform image from book Rotation.

    The Parameter Wiring dialog box appears.

  4. In the Parameter Wiring dialog box, click the direction arrow that points from the Slider to the head. In the expression text area under the head object, enter the expression angleaxis value [0,1,0] and click the Connect button.

  5. Click the Select and Manipulate button on the main toolbar, and drag the slider to the right. The crocodile's mouth opens.

Figure 31.11 shows the crocodile biting using the slider control.

image from book
Figure 31.11: A slider control is wired to open the crocodile's mouth.




3ds Max 9 Bible
3ds Max 9 Bible
ISBN: 0470100893
EAN: 2147483647
Year: 2007
Pages: 383

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net