Key attributes and methods – Adobe After Effects CS3 User Manual
Page 585

AFTER EFFECTS CS3
User Guide
580
Example: Animating with the propertyGroup method and propertyIndex attribute
Values of propertyGroup relative to brush stroke’s Position property
A. propertyGroup(4) B. propertyGroup(3) C. propertyGroup(2) D. propertyGroup(1) E. Position’s propertyIndex value is 2; Rotation’s
propertyIndex value is 4.
In this example, each brush stroke’s
propertyGroup
method targets the Brush property group because that group is
two property groups up from the Rotation property. The
propertyIndex
attribute in each Brush stroke then returns
a unique value for each Brush stroke. The resulting value is then multiplied by the time and 200 and applied to each
rotation value, rotating each brush stroke differently, creating swirling paint strokes:
propertyGroup(2).propertyIndex * time * 200
Animating a brush stroke with an expression
Key attributes and methods
When you access a Key object, you can get
time
,
index
, and
value
properties from it. For example, the following
expression gives you the value of the third Position keyframe:
position.key(3).value
.
The following expression, when written on an Opacity property with keyframes, ignores the keyframe values and
uses only the keyframes’ placement in time to determine where a flash should occur:
d = Math.abs(time - nearestKey(time).time);
easeOut(d, 0, .1, 100, 0)
value
Return type: Number or Array.
Returns the value of the keyframe.
time
Return type: Number.
Returns the time of the keyframe.
D
C
B
A
E