beautypg.com

Key attributes and methods (expression reference), Markerkey attributes (expression reference), Markerkey attributes – Adobe After Effects CS4 User Manual

Page 687: Expression reference)

background image

681

USING AFTER EFFECTS CS4

Expressions

Last updated 12/21/2009

Animating a brush stroke with an expression

Key attributes and methods (expression reference)

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 placement of the keyframes 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.

index

Return type: Number.

Returns the index of the keyframe.

MarkerKey attributes (expression reference)

You can access values for composition markers and layer markers using the same methods. Access layer markers
through the

thisLayer.marker

object; access composition markers through the

thisComp.marker

object.

For the purpose of expressions, markers are a special type of Key object, so you can use methods such as

nearestKey(time)

to access markers, and markers also have

time

and

index

attributes. The

index

attribute is not

the number (name) of the marker; it is the keyframe index number, representing the order of the marker in the time
ruler.

Expressions have access to all of the values for a marker that you can set in the Composition Marker or Layer Marker
dialog box. This expression on the Source Text property of a text layer displays the time, duration, index, comment
(name), chapter, URL, frame target, and cue point name for the layer marker nearest the current time, and whether
the marker is for an event cue point:

This manual is related to the following products: