User Guide

CHAPTER 10
324
Creating Expressions
4 Select the Bulge effect’s Bulge Center property in the Timeline window and choose
Animation > Add Expression.
5 Select the default expression text and type the following:
from_world(this_comp.layer("Magnifier").position)
6 Click outside the expression to activate it.
Moving a layer in a perfect circle
You can create an expression without using properties from other layers. For example, you
can make a layer revolve in a perfect circle or move back and forth diagonally.
To create a circular movement in one layer:
1 Start one layer.
2 Select the Position property for the layer and choose Animation > Add Expression.
3 Select the default expression text and type:
add([this_comp.width/2, this_comp.height/2],
[Math.sin(time)*50, -Math.cos(time)*50])
4 Click outside the expression to activate it.
After Effects expression language guide
Use the elements in the following sections, along with standard JavaScript elements to
write your expressions. Remember that you can also use the Expression Language menu
at any time to insert functions into an expression.
See “Accessing elements in an expression on page 317 for procedures on using this guide.
Expression language guide key
Use the following key when referencing the expression language guide:
Headings represent expression objects. All elements listed below a heading are attributes
(that you can retrieve from the object) or methods (that you can call on the object). Many
of the attributes and methods return other objects—look up those object types in this
guide to determine how to continue your expression.
UG.book Page 324 Wednesday, February 21, 2001 12:05 PM