Monday 28 January 2013

Creating Expressions


Creating Expressions

The easiest way to create an expression is to simply
Alt/Option-click the stopwatch of the property where you
want the expression to go. After Effects then creates a
default expression, adds four new tool icons, changes the
color of the property value to red (indicating that the value
is determined by an expression), and leaves the expression
text highlighted for editing.
 When you create an expression, After Effects creates a default
expression with the text highlighted for editing, changes the color of the
property value to red, and adds four new tool icons: an enable/disable toggle, a
Graph Editor toggle, a pickwhip, and an Expression Language menu fly-out.
At this point you have a number of options. You can simply
start typing, and your text will replace the default expression.
Note that while you’re in edit mode, the Enter/
Return key moves you to a new line in the expression (this
is how you can create multiline expressions) and leaves you
in edit mode.
Another option while the text is highlighted is to paste in
the text of an expression that you have copied from a text
editor. This is the method I generally use if I’m working on
a multiline expression.
Instead of replacing all the default text by typing or pasting,
you can click somewhere in the highlighted text to
create an edit point for inserting additional text.
Alternatively, you can drag the expression’s pickwhip
to another property or object (the target can even be in
another composition), and After Effects will insert the
appropriate text when you let go. Note that if an object or
property can be referenced using the pickwhip, a rounded
rectangle appears around the name as you drag the pickwhip
over it. If this doesn’t happen, you won’t be able to
pickwhip it.

Finally, you can also use the Expression Language menu to
insert various language elements.
After creating your expression, exit edit mode by clicking
somewhere else in the Timeline or pressing Enter on the
numeric keypad. If your expression text contains an error,
After Effects displays an error message, disables the expression,
and displays a little yellow warning icon .
You can temporarily disable an expression by clicking on
the enable/disable toggle.
Working with existing expressions is as easy as creating
them. Some common operations are
. Editing. Click in the expression text area to select the
entire expression; you now have the same options as
when creating a new expression. If your expression
consists of multiple lines, you may need to expand
the expression editing area to be able to see all (or at
least more) of it by positioning the cursor over the line
below the expression text until you see a double-ended
arrow and then clicking and dragging.
. Deleting. Simply Alt/Option-click the property’s stopwatch,
or you can delete all the text for the expression
and press Enter on the numeric keypad.
. Exposing. Select a layer in the Timeline and press EE to
expose any expressions applied to that layer.
. Copying. In the Timeline, select a layer property containing
an expression and choose Edit > Copy Expression
Only to copy just the property’s expression. You
now can select as many other layers as you’d like and
Edit > Paste to paste the expression into the appropriate
property of the other layers.

No comments:

Post a Comment