Action window
Purpose
To create new animation curves, edit animation curves, as well as cut and paste animation between different animation parameters. The Action Window also lets you create and edit expressions and attach these expressions to animation parameters. How to Use
Select Animation
Action window to open the Action Window. The different ways you can use this window are described in the following. Action Window
The Action Window has three components:

The Action Lister is always displayed on the left side of the Action Window.
On the right side, you can display either the graph editor or the timeview. Use one of the icons in the lister title bar to switch between the graph editor and the timeview.
The Action Window also has its own set of pull-down menus. They are:
ListMode
Edit
CurveTools
Pick
Xform
Views
DispTools
ActionTools
TangentType
Preferences
Some menus or menu functions are not applicable in some situations. For example, if the timeview display is active, you cannot use the Action Window Pick
Tangents function, since tangents are only visible with the graph editor. Unavailable functions appear in light gray text.
The minimum value that can be displayed is -1,000,000.00. The maximum is +1,000,000.00.

The key toggle is located to the right of the prompt line. When toggled on, the time slider bar is snapped to keyframes. When moving keyframes, they are snapped to keyframes of other keyframes.

The time snap toggle is located to the right of the key toggle. This toggle is used to constrain the movement when keyframes or the current time slider bar are moved.
When time snap is toggled on, the time slider bar and the time of keyframes snap to integer values. When toggled off, you can move selected keyframes and/or the slider time bar to any time.

The value snap toggle is located to the right of the time snap toggle. This toggle is used to constrain the movement when keyframes are moved.
When value snap is toggled on, the value of keyframes snap to integer values. When toggled off, you can move selected keyframes to any value.
Tip: This is similar to choosing Anim
View frame and selecting a new current time at which to view the world. You can also double-click in the time slider box to change the current time. When the box turns pink, with the existing time on a grey background, type the new current time. A single click in the time slider box updates the world. This is useful if you have changed any keyframe positions, as these changes are not automatically reflected in the world.
Show curve names is enabled in the Action Window, the expression will appear within the brackets). Channels animated by a single action may also have the name of the action curve displayed next to the parameter name (see Disp Tools
Tgl Curve Names in the Action Window). The Action Lister functions and the icons that may appear in the action lister window are described in the following sections.


This filter control panel is geared specifically towards dag node channels. For other types of objects, you can choose between the local and global settings in the Param Control window (see Animation
Param control). While the filter control panel is open, you cannot perform any other function in Alias. To close the filter control panel, click the param filter button.
A dag node has ten animatable parameters, but the most commonly used ones are the X, Y and Z translate, rotate and scale parameters. The 3X3 grid in the parameter control filter allows you to quickly turn the display of these nine parameters on and off, reducing the amount of data in the action lister.
To turn a parameter on or off, click in the appropriate box. For example, clicking in the second column of the first row turns off the Y translate parameter. Clicking in the box again turns it on again. You can toggle all the translate, rotate or scale parameters at once by clicking in the Tra, Rot or Sca buttons. Similarly, you can toggle all the X, Y or Z parameters by clicking on the X, Y or Z buttons respectively.
Below the 3 XYZ toggles are five more buttons.
The first button is a filter for animated channels. If this button is toggled on, only the channels with animation information in them will be displayed in the lister.
The second button, Visibility, is a filter for the tenth dag node animation parameter: It is represented as a dag node SBD box with a section removed from it.
The third button is a filter for the display of timing curves. It is represented by a clock and a curve. When a channel is animated by more than one action, it is considered to have a base action followed by one or more timing curves.
Timing curves are often applied to many channels at once, so it is sometimes handy to have them listed separately. (See Set motion on page 28 or Time Warps on page 341 for creating timing curves.)
If the timing curve button is toggled on, a list of all the timing curves of all channels of an item follows the list of all the item's animation parameters in the action lister. Each of these timing curves can be expanded to see which of the item's channels it applies to.
The timing curves for a channel are also listed when the channel is expanded to its animation curves.
The fourth and fifth buttons in the filter panel represent local and global parameter filters, and are represented by a quarter and a full globe respectively. These buttons are used to control which animation parameters are filtered out of the action lister for all animatable items other than dag nodes.
If neither of these buttons are selected, then all animation parameters for non-dag node items are listed. If only the local parameter button is selected, then only animation parameters are listed corresponding to those selected in the item's local parameter control.
If the global parameter button is selected, then only animation parameters selected in the global parameter control are used. See Animation
Param control for more details. When you have finished toggling buttons on and off in the param filter panel, click on the param filter button again to close the panel. The action lister updates to display the selected parameters.

The graph editor button is used to activate the graph editor (which appears to the right of the action lister). The graph editor lets you view and change action curves for any channel.

The timeview button is used to activate the timeview (which appears to the right of the action lister). The timeview lets you view overall animation timing for any channel, and create and edit expressions and attach them to animation parameters.
Tip: You can hold the Shift key while you select to add elements to a currently selected list. For example, if you want to select the 2nd and 3rd, and the 7th, 8th and 9th elements of the list, click on the 2nd element and drag down to the 3rd element. Then press and hold the Shift key, and click on the 7th element and drag to the 9th element. Now five elements are selected.
If you have selected more than one item in the list, the expand item button and expand animation button can be used to expand all selected items at once. For example, if there are five animated items in the lister and you select three of them, then click on the expand animation button for one of the selected items, all three selected items have their animation parameters added to the list.
You cannot rename CVs or polyset vertices, since these items get their names from the name of the dag node above them. You also cannot rename animation parameter names since these are names used throughout Alias to identify the parameter.
See Param control... on page 14 for a complete list of all animation parameters of all types of animatable items.

If an object has any descendants, it has an expand item button next to its name (on the far left).
If this button is pressed, the action lister adds the object's descendants to the lister. The new sub-objects are indented with respect to the first object to show the object's hierarchy. For example, if a dag node above a surface is in the lister, it has an expand item button. When this button is pressed, all the surface CVs are listed.
If an object is expanded and its expand object button is pressed again, the item compresses- that is, the descendants of the object are removed from the action lister.
If you hold the Shift key while clicking on the expand item button, the item expands to its children, each of the children expand to their children, and this continues until no items below the original item can be expanded.
Using the Shift key to expand does not expand leaf geometry dag nodes to their CVs. This restriction is made so that you can expand dag node hierarchies quickly without having to list the potentially large number of CVs that belong to curves or surfaces.

If the item in the lister is animatable, it has an expand animation button next to its name (between the expand item button and the item type icon). If this button is pressed, the action lister adds the item's animation parameters into the lister. This depends on the parameter control settings in the param filter panel.
If an item is expanded to show its animation parameters, the expand animation button can be pressed again to compress the items and remove the animation parameters from the lister.

If an animation parameter is animated, it has a channel associated with it. If the channel has more than one action associated with it (for instance, it has at least one timing curve applied to its base action), then it has an expand channel button next to its name. If this button is pressed, the action lister adds the channel's action curves to the lister.
The new actions are indented with respect to the channel. Actions are listed in the order in which they are applied, with the base action being listed first. If a channel is expanded and its expand channel button is pressed again, the channel compresses- that is, the actions of the channel are removed from the action lister.

The curves that are displayed in the graph editor reflect what is currently in the action lister. For example, if an item has three parameters that are animated each by a single curve channel, then three actions will be displayed in the graph editor.
If a channel has two or more actions on it (a base action and timing curves, for example, which could be created using Set motion), the channel appears in the lister with an expand channel button. When this button is pressed, the channel's animation curves are added to the lister and to the graph editor. If the channel is not expanded, only the resulting animation curve on the channel will be displayed in the graph editor. The result curve is the final evaluation of the channel with all of its actions. Result curves will always be displayed as dashed lines because they are not editable.
Shortcut: You can toggle the display of result curves on or off by selecting Show/Hide result curves from the Disp Tools menu in the Action Window.
Channels and animation curves in the graph editor can be picked by selecting the name of the animation parameter in the action lister.
Curve, their curve names are highlighted in the action lister.

The timeview is an alternate way of viewing actions and channels. You see only timing information, without their values. The timeview can be useful if you are satisfied with the motion in your animation, but want to adjust the timing. You can edit individual actions, single channels of an animatable item or channels for the whole animatable item. This can also be useful for coordinating objects' movement in your scene.
The summary bars of channels can be edited if the channel uses only one action, and this action is a parameter curve. If the channel can't be edited, it has a dashed outline. In this case you can expand the channel and edit its individual parameter curves.
Clear to remove animation from an animation parameter). Double-clicking in the list area next to the desired animation parameter allows an expression to be entered (you can also use Edit
Edit expression to use the external editor defined in Alias Preferences to edit or create an expression).

The List Mode menu specifies which objects are displayed in the action lister.
Multi-lister).
Playback options).
Other types of items that are listed in this mode include the Universe and all animatable perspective windows.

The Edit menu is used to perform operations on items selected in the action lister.

Once the window is opened, pick a keyframe. You can then unpick that keyframe and pick another one, and the information in the stats window is updated for the new picked keyframe. Each of the parameters in the keyframe stats window are explained in the following.
You will not be able to enter a frame time that is outside the segment in which the keyframe is contained.

Next to the tangent values is a tangent lock button. When you click this button and if one of a keyframe's tangent values is changed, the other tangent is changed so that the relationship between the two tangent values remains. For example, if the in-tangent is 10 degrees and the out-tangent is 30 degrees, and you change the out-tangent value to -20 degrees (a decrease of 50 degrees), then the in-tangent value will be changed an equivalent amount to 60 degrees.
The tangent lock button only takes effect if you change a tangent value in the keyframe stats window. To maintain a tangent relationship when changing tangents using Xform
Move, use the right mouse button.
Tip: For more information on tangent types, see the description of the Tangent Type menu.
If the values are not all the same, the value in the keyframe stats window will be gray. You can click on a value in gray and enter a new value, and then all picked keyframes will assume this same value. For example, if you pick two keyframes, and one has a value of 5, and the other has a value of 10, then the keyframe stats will show the value of one of the keyframes in gray, indicating that not all picked keyframes have the same value. If you click on this grayed value, and type in 7, now both keyframes will have a value of 7, and it will be displayed in black as all picked keyframes now have the same value.
If multiple keyframes are picked and they all have the same tangent type, then this tangent type will be displayed. If not all keyframes have the same tangent type, then the Tan' Type parameter will say Unknown. You can click on an Unknown tangent type and select another tangent type, and then all keyframes will assume this same tangent type.
Tip: Tangent angles and tangent types can also be copied from one keyframe to another using Edit
Copy and Edit
Paste.
If you cut only one channel or action curve, the animation is placed on the clipboard (replacing anything that may have been there already) so you can paste it later onto an unanimated parameter (see Paste and Paste Instance).
If a tangent is picked, both the tangent angle and tangent type are copied.
Paste Segment WIth Offset will offset the values of the pasted segment (i.e. raise or lower the segment) so that its first keyframe sits precisely on the selected curve at the specified time. Paste Segment will leave all of the values in the pasted segment untouched.
Click or drag on curve to define insert location (time, [repeat], [gap]):
To paste a segment onto an unanimated parameter, you must use keyboard input.
To remove the animation from a parameter, for example, select the parameter in the action lister, then use Clear to delete the channel.
Only the animation is deleted, the parameter itself still remains in the lister, but is now shown in a dim color to reflect its lack of an animation.
Tip: If you clear something by accident, use Undo to restore it.
Set motion) or a new timewarp (using Animation
Time Warps
New time warp), then the animation curve(s) created are shared by more than one channel. If you want to see all the channels that are using a particular action curve, select the action and choose Show Instance from the Edit menu.

Undo keeps a history of transformations, so that if you repeat Undo, it will undo further back in the history.
You can use Redo to reverse the last operation from Undo. You can redo as many operations as you undid with Undo.
Delete operations which are performed outside the Action Window (for example, Delete
Del active or Delete
Del channels) will delete the undo history in the Action Window.

The Curve Tools menu is used to perform operations on items selected in the action lister.
Curve).
Insert keyframes and click and drag to the frame at which you would like to insert the keyframe.
This function is very useful if a channel is animated with several timewarps, and you want to edit the channel as a whole, instead of as individual actions.
Use result. You are prompted to enter a start, end and by value at which to sample the channel.
Select actions to simplify. Enter range & tolerance ([start], [end], [by], [0.050]):
The by option is the frame tolerance. The by option means that the simplified action will be equivalent to the original action (within a value tolerance) at the by value spacing. The fourth number to enter is the value tolerance. This specifies by how much each frame at the by spacing is allowed to differ in value in the simplified action from the original action.
When you select Simplify, you can either press Enter, type just one number, or four numbers. If you type one number, this number is used as the value tolerance. If you type four numbers, these numbers are interpreted to be the start, end, by and value tolerance respectively. The default values for start and end are the complete range of the actions selected. The default by value is 1, and the default tolerance value is 0.05.
If a keyframe is locked, it cannot change location or value when you perform an Xform
Move. This is useful if you want to ensure that a specific keyframe happens at a specific time, and you want to avoid accidentally moving it. Locked keyframes are displayed as hollow squares in the graph editor and hollow triangles in the timeview.

The Pick menu is used to pick various items in the action editor. Pick is similar to the standard Alias Pick, but it operates on actions and channels. You can pick by clicking the item to pick, or you can click-drag to create a pick box. Everything inside the pick box is made active. To unpick an item, pick it a second time.
You can also pick curves by typing the curve name in the prompt line. Wildcard characters (such as *,?) can be used to select curves with similar names. For example, sphere.*Translate will pick all the sphere's Translate animation curves. Use Disp Tools
Show curve names to display the names of the curves.Tip: The graph editor Pick functions have the added capability of picking while you are in other functions. If you hold the Shift key, you are automatically in Pick mode no matter which menu item is current.
Since keyframes, tangents, and actions cannot be picked at the same time, a pick priority defines what is picked if all three of these action components are inside the pick box: keyframes, then tangents, then the action itself.
You can pick keyframes in a certain time range by typing the first and last time of the range at the keyboard. Be sure that your cursor is in the Action Window so that keyboard input goes to the Action Window. Keyframe display can be toggled on or off using Disp Tools
Show keyframes.
Tgl template.

The Xform menu is used to perform operations on items selected in the action lister, time view, or graph editor.
If you hold down the Ctrl key while moving tangents, instead of proportional movement, you get direct movement, where the tangents point directly at the current position of the selection arrow:
For example, typing A 10 5 moves a keyframe to the time 10, and value 5. If you then type R 2 1, the keyframe is placed at time 12 and value 6. You can enter either positive or negative numbers.
If a curve is picked, Move moves the whole curve with respect to the first keyframe on the curve.
If a tangent is picked, only one value needs to be entered at the keyboard. This value is an angle between -90 and 90 degrees. An angle of 0 degrees means the tangent is horizontal. You cannot assign the value of -90 or 90 to a tangent because this would produce a vertical line in the curve. You can assign tangent values close to -90 or 90.
Enter (start, end, new start, [new end]):
Scale time is only available via keyboard input, and not interactively.
Enter y-axis pivot value, scale factor:
For example, if the keyframe value is currently 80, and you specify a pivot value of 70 and a scale factor of 2, then the current scale is 80 - 70 = 10. This value is multiplied by the scale factor to obtain the new scale value of 20. Thus the resulting keyframe value is the pivot value 70 plus the new scale 20 to equal 90.
Scale value is only available via keyboard input - not interactively.
Use the middle mouse button to randomize the keyframes in time only. Use the right mouse button to randomize the keyframes in value only.

The Views menu is used to perform operations on the view in the graph editor and timeview.
The time and location ranges displayed in the graph editor are bounded by the lowest and highest time and location values of all of the curves.
Curve.
Look at, and the view changes to show the full extent of the selected curves (the other curves are still displayed, but they may not be visible, or may be only partly visible).

The Disp Tools menu is used to change the display of items in the graph editor. Each of the functions are toggles.
Tgl template function in the main Alias window.
curve), and select Disp Tools
Tgl template. If the curve was templated, pick the curve using Pick
Template, and select Disp Tools
Tgl template to untemplate it.
Tgl keyframe lock, or a small box if they have been locked.
If stats are on, and a keyframe is picked, the (x, y) co-ordinates of the keyframe are displayed. If a tangent is picked, the angle of the tangent is displayed. Information is displayed as shown in the following example.

The higher the amplitude in the graph, the louder the recorded sound. You can use the sound graph to match movements of your animating objects with specific sound cues. You can display the sound graph by viewing only the left or right sound channels, both at once, or an average of the two channels. To flip between these four different display modes, click in the sound graph.
For more information about using sound files, see the Sound Options in Playback options on page 61.

The Action Tools menu is used to change the behavior of curves outside their defined range. You can also add comments to your actions.
Shortcut: You can display how an action is evaluated out-of range by selecting Disp Tools
Show infinity.

Constant Before means that the curve retains the same value as the value of the first keyframe (or at time 0 for motion path actions) for all time values before this first keyframe.
Constant After means the value of the last keyframe (or at time 100 for motion path actions) is used for all time values after the last keyframes. This is the default out-of-range type for parameter curve actions.

Cycle Before means that the curve repeats itself before the first keyframe. This is just as if a copy of the curve was taken and pasted repeatedly before the first keyframe.
Cycle After means that the curve repeats itself after the last keyframe. This is like a copy of the curve being copied and pasted repeatedly after the last keyframe.

Cycle Before with offset is the same as Cycle Before, except it continues vertically from where the previous cycle left off. (It does not repeat from the same vertical position.)
Cycle After with offset is the same as Cycle After, except it continues vertically from where the previous cycle left off.

Oscillate Before and Oscillate After means that the curve repeats itself backwards, then forwards, then backwards, and so on. This is just as if a copy of the curve was taken, and first glued to the curve in the reverse (or mirror) direction, then in the forward direction, then in the mirror direction, and so on.

Linear Before means that the curve continues in a straight line along the in-tangent of the first keyframe.
Linear After means that the curve continues in a straight line along the out-tangent of the last keyframe. Since motion path actions do not have editable tangents, linear means that the curve continues along the actual tangent of the curve.

Identity Before and Identity After means that the curve continues in a straight line at a slope of 45 degrees (or parallel to the line y = x starting at the first/last keyframe). This is the default out-of-range type for timewarp actions created with Anim
Time tools.
Edit comment, which lets you add comments to objects in the modeling world.Pick one curve in the graph editor, and select Edit Comment. A shell window running an editor is opened, and you can add new comments or edit previous ones for the action. When you quit the editor, the window closes and you can continue working.

The Tangent Type menu is both a mode and a function, and it operates on currently picked keyframes.
Append keyframes or Curve Tools
Insert keyframes menu items to add new keyframes to an action. As each keyframe is added, the new keyframe's tangent is computed, based on the current tangent type.
Show tangents.
For finer control on the keyframes' tangents, pick the desired tangents using Pick
Any tangents, Pick
In tangents or Pick
Out tangents, then use Xform
Move to adjust the tangent. This will cause the modified tangents' type to become fixed.

The new keyframe's tangents create a smooth transition between the keyframe before it and the keyframe after it. The tangents are co-linear (that is, they are both at the same angle). This ensures that there is no jerkiness at the keyframe.
The angle of the tangents is a weighted average of the slopes between the two keyframes on either side of the new keyframe. Setting a keyframe to Smooth sets the tangent type of the in- and out-tangent of the keyframe to smooth.

The action is in a straight line between the previous keyframe and the new keyframe. The out-tangent of the previous keyframe and the in-tangent of the new keyframe lie along this straight line. Setting the tangent type of a keyframe to Linear seg in changes the in-tangent type of the picked keyframe to linear and the out-tangent type of the previous keyframe to linear.
Linear seg out

The action is in a straight line between the new keyframe and the next keyframe. The out-tangent of the new keyframe and the in-tangent of the next keyframe lie along this straight line. Setting the tangent type of a keyframe to Linear seg out changes the out-tangent type of the picked keyframe to linear and the in-tangent type of the next keyframe to linear.

The movement slows as it enters the keyframe. Setting the tangent type of a keyframe to Slow seg in changes the in-tangent type of the picked keyframe to slow and the out-tangent type of the previous keyframe to fast.

The movement is slower at the beginning of the curve segment following the keyframe. Setting the tangent type of a keyframe to Slow seg out changes the out-tangent type of the picked keyframe to slow and the in-tangent type of the next keyframe to fast.

This eases out of the new keyframe, and eases in to the next keyframe. Setting the tangent type of a keyframe to In/Out changes the out-tangent type of the picked keyframe and the in-tangent type of the next keyframe to in-out.

The movement is faster going into the selected keyframe. For example, a car accelerating. Setting the tangent type of a keyframe to Fast seg in changes the in-tangent type of the picked keyframe to fast and the out-tangent type of the previous keyframe to slow.

The movement is faster going out of the selected keyframe. For example, throwing a ball. Setting the tangent type of a keyframe to Fast seg out changes the out-tangent type of the picked keyframe to fast and the in-tangent type of the next keyframe to slow.

The in- and out-tangents of the new keyframe are horizontal (that is, with a slope of 0). Setting the tangent type of a keyframe to Flat changes the in- and out-tangent types of the picked keyframe to flat.

The out-tangent of the new keyframe is flat. The curve segment is also flat (horizontal) until the next keyframe, at which point it jumps up or down to the value of that keyframe. The step tangent type is useful for animating Boolean (ON/OFF) values such as dag node visibility, or the presence/absence of a light's shadows. A value larger than 0.5 means ON, and less than 0.5 means OFF. Setting the tangent type of a keyframe to Step changes the out-tangent type of the keyframe to step.
If a keyframe's out-tangent type is step, then it is irrelevant what the in-tangent type of the next keyframe is as it will be ignored.

To display an Action Window marking menu:
Edit marking menus. A shelf window for the current tools in the marking menu is displayed:

Shortcut: You can always perform a viewframe by clicking on the frame indicator in the Action Window (see Animation
Action window for more information).
Short expressions are case-insensitive. Any combination of characters and the underscore, "_" is recognized. For example, sphere:xt is equivalent to the following:
sphere: xt
sphere: tx
sphere: Tx
sphere: t_x
sphere: x_t and
sphere:x_Translate
The following section describes the syntax or rules to be followed when entering an expression, and a discussion on the valid mathematical operations.
Expressions give you the ability to establish a dynamic link between animatable parameters so that a change in one parameter (as in the rotation of a joint) can cause another parameter (as in the deformation of a surface) to be updated automatically.
The expression system provides simple mathematical operations (+ - * /), most of the functions supported by SDL, and allow references to DAG node and CV parameters, as well as the current frame value. Any animatable parameter can have an expression defined to calculate its value.
Expressions are created using the Timeview window within the Action Window. Any parameter that is not currently animated can have an expression attached to it (use Edit
Clear to remove animation from an animation parameter). Double-clicking in the list area next to the desired parameter allows an expression to be entered (use Edit
Edit expression to use the external editor defined in Alias Preferences to edit or create an expression).
ObjectName[.CVreference]:Parameter
Expression references can only refer to dag nodes (and their CVs). For example, references to shader and light parameters are not supported.
.: mySphere
..: SubLevel2
..\..: SubLevel1
..\..\..: BaseLevel
\: BaseLevel
surfaces u#v#
curves u#
curves within a face c#u#
polysets v#
X_Translate or tx Local X Translate of the DAG node
Y_Translate or ty Local Y Translate of the DAG node
Z_Translate or tz Local Z Translate of the DAG node
X_Rotate or rx Local X Rotation of the DAG node, in degrees
Y_Rotate or ry Local Y Rotation of the DAG node, in degrees
Z_Rotate or rz Local Z Rotation of the DAG node, in degrees
X_Scale or sx Local X Scale factor of the DAG node
Y_Scale or sy Local Y Scale factor of the DAG node
Z_Scale or sz Local Z Scale factor of the DAG node
Visibility A Boolean specifying whether or not this DAG is visible
X_Position or px Local X Position of the CV
Y_Position or py Local Y Position of the CV
Z_Position or zp Local Z Position of the CV
Weight The weighting factor for this CV
sphere:X_Translate X Translate of the object sphere
sphere.u2v3:X_Position X position of the u2v3 CV within the object sphere
..\..:X_Translate X Translate of the DAG node two levels "up"
acos (radians) acosd (degrees)
asin (radians) asind (degrees)
atan (radians) atand (degrees)
atan2 (value, value) atan2d (value, value)
cos (radians) cosd (degrees)
cosh (value)
sin (radians) sind (degrees)
sinh (value)
tan (radians) tand (degrees)
tanh (value)
besselj0 (value) besselj1 (value)
besseljn (order, value) besselyn (order, value)
ceil (value)
constrain (start, end, by, value)
erf (value) erfc (value)
fabs (value)
floor (value)
fmod (value, divisor)
gamma (value)
gauss ()
hypot (x, y)
log10 (value)
pow (value, power)
rand ()
srand (seed)
sign (value)
sqrt (value)
animate (action curve, expression)
Note: The animate function takes action curves as its first argument and not channels. The action curves must be keyframe actions and not motion path actions.This distinction is important. The animate function does not reference a parameter such as sphere:X_Translate, but rather it references the same action curve as sphere:X_Translate references.You can see the name of any action in the Action Window (see Disp Tools
show/hide curve names in the Action Window). The action curve on a channel can also be referenced using animate ({parameter reference}, frame). After the expression is entered, the parameter reference will be replaced by the action curve reference.The animate function provides two very useful capabilities:
An example of a logical operation would be to set the position of an object based upon a decision:
if the distance along the X axis between a cube and a cone is less than 3 units
then return the pyramid's X Translate value less 4 units
otherwise return the cube's X Translate value less 5 units
This would be entered as:
((fabs (cube:X_Translate - cone:X_Translate) < 3) * (pyramid.X_Translate - 4)) +
((fabs (cube:X_Translate - cone:X_Translate) >= 3) * (cube:X_Translate - 5))
parameter = some expression
Also, all of the examples are built in a Y-Up orientation.
Tip: Turn Expression updates during XForm ON to see the expressions update as the mouse is moved (See Preferences
Performance options).
joint:Z_Rotate = joint#5:Z_Rotate / 2
joint#2:Z_Rotate = joint#5:Z_Rotate
joint#3:Z_Rotate = joint#5:Z_Rotate
joint#4:Z_Rotate = joint#5:Z_Rotate
This establishes the rotational relationship between the finger joints. Now as the finger tip (joint#5) is rotated about the Z-axis (using Xform
Rotate). The other joints will rotate an equal amount, giving a very realistic motion to the finger.Tip: Expressions may be copied and pasted within the Action Window just like any other animation channel (See Edit
Copy and Edit
Paste in the Action Window).
smallGear:Y_Rotate = gear:Y_Rotate * -2
link#1:Y_Rotate = - gear:Y_Rotate
link#2:Y_Rotate = - link#1:Y_Rotate
Notice that the smallGear is half the size of the gear, and should then rotate twice as fast as the gear. The negative sign in front of each reference causes the gears to rotate in opposite directions.
There are also various expressions which link the rotation of the reels to the amount of tape that has been played. The amount of tape that is played is controlled by the scale of the take-up reel. While it makes sense from an expression perspective, manipulating the scale of the take-up reel is neither intuitive nor easy (since the take-up itself is embedded within another object, it is hard to pick the correct object).
So the expression relationship has been extended one level, where the scale of the take-up reel is linked to the horizontal position of a control object (in this case a little triangle). As you move the triangle back and forth, the whole tape assembly will perform as if tape was being moved back and forth. The complete relationship is described below:
The following expressions establish the scale of the take-up reels:
rightTape:X_Scale = (control:X_Translate / 2) + 4
rightTape:Z_Scale = .:X_Scale
leftTape:X_Scale = 18.5 - rightTape:X_Scale
leftTape:Z_Scale = .:X_Scale
The next expressions establish a link between the size of the take-up reels and the amount of rotation of the reels:
rightReel:Z_Rotate = log10 (1 + ((rightTape:X_Scale - 4) / 1.5)) * 36000
leftReel:Z_Rotate = log10 (1 + leftTape:X_Scale - 4) / 1.5)) * 3600
The last set of expressions make the tape itself adjust to the size of the take-up reels:
Note: For clarity, expressions on some of the CVs has been omitted
tape.u0v0:X_Position = -3.25 + (((14.5 - leftTape:X_Scale) / 10.5) * 5.25)
tape.u0v1:X_Position = tape.u0v0:X_Position
tape.u10v0:X_Position = 30.25 - (((14.5 - leftTape:X_Scale) / 10.5) * 5.25)
tape.u10v1:X_Position = tape.u10v0:X_Position
For the purposes of animating the tape reels, you just need to set keyframes on the position of the control object itself. (To see a sample animation, just select Animation
Playback).
The expression which is applied to the dust shader (albeit very simplistic) is:
dust:psys_particles_per_sec = (ballObject:Y_Translate < 0.25) * 500
Now if you select Anim
Run dynamics, as the ballObject bounces, little puffs of dust will be emitted (this is a simplistic example: as the ball settles, more "dust" will be emitted)Notice how this expression uses the logical operation to compare the position of the ballObject, and then set the particle emission accordingly. Expressions may be applied to any shader parameter, particle emission was chosen because it produces an immediately visible result.
sphere#2:Y_Translate = animate (yTrans, frame - 5)
sphere#2:Y_Rotate = animate (yRotate, frame - 5)
sphere#3:Y_Translate = animate (yTrans, frame - 10)
sphere#3:Y_Rotate = animate (yRotate, frame - 10)
sphere#3:X_Translate = sind (frame * 3.6) - 6
The last expression is added just to make the third sphere behave a little differently.
Any scalar value can be used for the second parameter to animate, including another animate function. The second parameter is simply an expression whose value will be used as the frame to evaluate the action curve. Evaluation of the action curve outside its defined range follows the settings for the extrapolation type for the curve (see Action Tools in the Action Window).
The expressions that form the animation include:
pendulum:Z_Rotate = animate (animNode.Z_Rotate, fmod (frame, 60)) *
((animNode:X_Rotate - frame) / animNode:X_Rotate)
animNode:X_Rotate = 500
The second parameter to the animate function is set to range between 0 and 60 (the original range of the keyframes). A similar result could have been achieved by just using animate (animNode.Z_Rotate, frame) and then changing the extrapolation on the animNode.Z_Rotate curve to cycle after.
Notice how animNode:X_Rotate is being used as a simple variable. That way if the timing of the sequence needs to be changed, then only the value of animNode:X_Rotate needs to be changed. All other expressions will then be evaluated using the new value.
sphere:Y_Translate = animate (Noise, frame)
The noise "function" could also be used to modulate the evaluation of other animation curves, in effect supplying a follow-type expression with a slightly random but controllable behavior. In the same example, sphere#2 was animated using keyframe animation, and then sphere#3 has a "follow" type series of expressions, with the Noise "function" being used to add a little randomness to the follow of the X_Translate:
sphere#3:Y_Rotate = animate (sphere#2.Y_Rotate, frame - 5)
sphere#3:X_Translate = animate (sphere#2.X_Translate, frame - 5) -
(animate (Noise, 60 + fmod (frame, 15)) * 0.375)
For the X_Translate, the Noise "function" is evaluated over the range from 60 to 75.