beautypg.com

Expression basics, About expressions – Adobe After Effects User Manual

Page 672

background image

Expression basics

To the top

Note:

Note:

About expressions
Add, edit, and remove expressions
Example: Use the expression language reference to write an expression
Show expressions and the expression graph
Writing expressions for source text
Add comments to an expression
Save and reuse expressions
Expression Controls effects
Convert an expression to keyframes
The expression language
Expression errors

Many of the examples in this section are based on examples provided by Dan Ebberts. Dan Ebberts also has an excellent collection of example
expressions and tutorials for learning how to work with expressions on his

MotionScript website

.

The

AE Enhancers forum

provides many examples and much information about expressions, as well as scripts and animation presets.

Chris and Trish Meyer provide a simple video overview of expressions on the

ProVideo Coalition website

.

Chris and Trish Meyer provide a

series of articles about expressions on the ProVideo Coalition website

. These articles contain many useful

examples.

Chris and Trish Meyer share tips about expressions from their book _Creating Motion Graphics_

on the ProVideo Coalition website

.

About expressions

When you want to create and link complex animations, but would like to avoid creating tens or hundreds of keyframes by hand, try using
expressions. An expression is a little piece of software—much like a script—that evaluates to a single value for a single layer property at a specific
point in time. Whereas scripts tell an application to do something, an expression says that a property is something.

With expressions, you can create relationships between layer properties and use the keyframes of one property to dynamically animate other
layers. For example, you can use the pick whip to link path properties, so a mask can take its path from a brush stroke or a shape layer object.

The expression language is based on the standard JavaScript language, but you do not need to know JavaScript to use expressions. You can
create expressions by using the pick whip or by copying simple examples and modifying them to suit your needs.

Two sources of example expressions are the Expression Sampler template project (File > Browse Template Projects) and the animation

presets in the Behaviors category (Animation > Browse Presets).

Animation presets can include expressions, or even consist entirely of an expression. Animation presets that use expressions instead of keyframes
are sometimes called behaviors.

After you add an expression to a property, you can continue to add or edit keyframes for the property. An expression can take the value of a
property as determined by its keyframes and use that as input to generate new, modified values. For example, the following expression on the
Rotation property of a layer adds 90 degrees to the value of the Rotation property, in addition to the keyframed motion:

value + 90

Some methods—such as wiggle—operate directly on the keyframed property values. (See Property attributes and methods (expression

reference).)

The following expression on the Position property of a layer preserves the keyframed motion of the layer and causes it to wiggle a little:

wiggle(10, 10)

Using the wiggle expression is often much faster and easier than using the Wiggler.

668

This manual is related to the following products: