• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL

Chapter 4. What's New in Animation > Expose Transform Helper

Expose Transform Helper

With the new Expose Transform helper, you can now immediately expose the position, rotation, and scale values of a child object in relationship to its parent. This has important implications for the scripting of custom rigging tools and procedural animation. For example, information on how the rotation of the forearm relates to the upper arm can now be delivered to a script or wired to drive animation of the character's shoulder, without the need to jump through hoops to gather the necessary rotational, positional, and scalar values—they are all immediately available through the Expose Transform helper.

To use the Expose Transform helper, first pick a child node; Expose Transform then automatically relates the child node to its parent node. If you uncheck the Parent button, you can choose any other object in the scene and retrieve values for its relationship to the original child node.

Each exposed parameter has an M button next to it; click it to copy the correct transform name to the Windows clipboard. For example, if you press the M button to the right of the Z value for Local Euler Angles, then the string $ExposeTransform01.localEulerZ will be stored in the Windows clipboard. Type Control-V to paste this value into any active Windows text application or the MAXScript editor (Figure 4.1). In this example, the Pin Stack button is used so that transformations to bone 3 allows us to see the resulting changes to Bone 2 in the Expose Transform helper object. Even though Bone 3 is selected, the pinned modifier stack displays the parameters of the Expose Transform Helper. Using the Expose Transform helper. Bone02 can be seen to be a child of Bone01 with an angular relationship to it. The M button is used to copy the appropriate MAXScript name to the windows clipboard. That name can then be pasted into a MAXScript document, where it might be useful.

Figure 4.1. Using the Expose Transform Helper. Bone02 is a child of Bone01 and has an angular relationship to it.

The script code $ExposeTransform01.localEulerZ will constantly track and return the current value in the Local Euler Z axis for the object named ExposeTransform01. Other objects in the scene can call this information to perform any number of actions as long as the current value meets certain requirements or falls into a designated range.

Using Expose Transform

To see how the Expose Transform helper works, we'll show how to use transform data to drive an animation. The scene in the following tutorial contains three objects: a plane, a box, and a cylinder. We'll expose the distance between the plane and the box and use this value to drive an animation of the cylinder. The further the box is from the plane, the more the cylinder will bend.

Go to the DVD that accompanies this book and open the file entitled expose transform start.max.

Select the Expose Transform object, click the Expose Node button in the Modify panel, and pick the box. The Local Reference Node button is gray because the Parent box is checked (that is, with Parent on you can see only info from a parent of the chosen object).

Uncheck the Parent check box, click the Local Reference Node button, and pick the plane (Figure 4.2).

Figure 4.2. Parent is unchecked so that the plane can be assigned as the Local Reference Node. The box has a Distance To Reference relationship of 0.0 to the plane.

Note that the Distance To Reference value is 0.0 because the pivot points for the box and the plane are in the same place. Next, we'll wire the bending of the cylinder based on the distance from the plane's pivot point to the Distance To Reference value in the Expose Transform object (the pivot point of the box).

Click the cylinder and right-click-select Wire Parameters from the menu. Then choose Modified Object > Bend > Angle from the menu (Figure 4.3).

Figure 4.3. Choosing the cylinder's Bend Angle.

With the dotted line coming from the cylinder, click the Expose Transform helper and choose Object (ExposeTransformHelper) and Distance from the menu (Figure 4.4).

Figure 4.4. Setting the Expose Transform helper's Distance.

The Parameter Wiring dialog pops up. Click the One Way Connection button pointing to the left and then click the Connect button (Figure 4.5).

Figure 4.5. A connection is made between the cylinder's Bend Angle and the Expose Transform helper's Distance parameter.

Select and move the box up, down, left, and right. Then select and move the plane up, down, left, and right.

No matter which direction the box moves or the plane moves, the further they are from one another, the more the cylinder will bend. Open the file labeled expose transform finish.max to see the results.

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint