2009

Table Of Contents
4 In the Expression Name box, you can optionally enter an expression
name, for instance, ScaleBallHeight.
If you write several expressions in the same scene, giving each a name
might make it easier to find the desired expression if you decide to alter
it later. If you dont provide a name, the expression receives a default
name, for instance, expression1.
Note that the Attributes list displays Balls keyable, unlocked
attributesthe attributes youll most likely want to animate with an
expression. Use the scroll bar to see the entire list.
5 Enter this expression in the expression text area:
Type all characters exactly as shown above. Entries are case sensitive. The
semicolon (;) signifies the end of the expression statement. End each
statement in an expression with a semicolon.
An error message appears in the Script Editor and Command Lines
response area if the expression has incorrect syntax or typing mistakes.
6 Click Create to create the expression.
Creating the expression checks it for syntax errors and converts it to a
form Maya can execute when you return to the start time or play the
animation. Clicking this button also executes the expression for the
current frame.
The expression sets Balls scaleY attribute to the value of time + 1.
Ball.scaleY is the full name of the attribute. A period separates the name
of the object and attribute. Note that you must spell the object and
attribute with uppercase and lowercase letters as they appear in the
Expression Editors Objects and Attributes lists.
The word time is a commonly used predefined variable that updates as
an animation plays. It contains the elapsed number of seconds from the
first frame to the current frame. The value increases with the increasing
frame number.
568 | Chapter 12 Expressions