Add, disable, or remove an expression, Edit an expression with the pick whip – Adobe After Effects CS4 User Manual
Page 654
648
USING AFTER EFFECTS CS4
Expressions
Last updated 12/21/2009
For example, you can double the result by typing
*2
at the end of the expression; or you can halve the result by typing
/2
at the end of the expression.
As you develop comfort editing expressions, you can combine these simple operations—and more. For example, you
can add
/360*100
to the end of an expression to change its range from 0-360 to 0-100. This change would be useful if
you wanted to convert the values of a 360-degree dial to a slider that is measured in percentages.
The Expression Language menu in the Timeline panel contains language elements specific to After Effects that you can
use in an expression. This menu is helpful for determining valid elements and their correct syntax; use it as a reference
for available elements. When you choose any object, attribute, or method from the menu, After Effects automatically
inserts it in the expression field at the insertion point. If text is selected in the expression field, the new expression text
replaces the selected text. If the insertion point is not in the expression field, the new expression text replaces all text
in the field.
The Expression Language menu lists arguments and default values. This convention makes it easy to remember which
elements you can control when you write an expression. For example, in the language menu, the wiggle method in the
Property category appears as
wiggle(freq, amp, octaves=1, amp_mult=.5, t=time)
. Five arguments are listed
in the parentheses following
wiggle
. The
=
in the last three arguments indicates that using those arguments is
optional. If you specify no values for them, they default to 1, .5, and the current time, respectively.
Important: You must replace the argument names written by the Expression Language menu with actual values.
wiggle
,
smooth
, and
loop
expressions to selected properties. Using this script is a good way for a beginner to experiment with expressions.
Jeff Almasol provides a script that automatically processes expressions, making specified changes. For example, the
script can be used to automatically remove or enable disabled expressions. For more information, see Jeff Almasol’s
More Help topics
About animation, keyframes, and expressions
Add, disable, or remove an expression
•
To add an expression to a property, select the property in the Timeline panel and choose Animation
> Add
Expression or press Alt+Shift+= (Windows) or Option+Shift+= (Mac OS); or Alt-click (Windows) or Option-click
(Mac OS) the stopwatch button
next to the property name in the Timeline panel or Effect Controls panel.
•
To temporarily disable an expression, click the Enable Expression switch
. When an expression is disabled, a
slash appears through the switch
.
•
To remove an expression from a property, select the property in the Timeline panel and choose Animation
>
Remove Expression, or Alt-click (Windows) or Option-click (Mac OS) the stopwatch button next to the property
name in the Timeline panel or Effect Controls panel.
Edit an expression with the pick whip
If you are not familiar with JavaScript or the After Effects expression language, you can still take advantage of the
power of expressions by using the pick whip. You simply drag the pick whip
from one property to another to link
the properties with an expression, and the expression text is entered in the expression field at the insertion point. If
text is selected in the expression field, the new expression text replaces the selected text. If the insertion point is not in
the expression field, the new expression text replaces all text in the field.