beautypg.com

Comp attributes and methods – Adobe After Effects CS3 User Manual

Page 572

background image

AFTER EFFECTS CS3

User Guide

567

radiansToDegrees(radians)

Return type: Number.

Argument type: radians is a Number.

Converts radians to degrees.

Comp attributes and methods

layer(index)

Return type: Layer, Light, or Camera.

Argument type: index is a Number.

Retrieves the layer by number (order in the Timeline panel). Example:

thisComp.layer(3)

layer(name)

Return type: Layer, Light, or Camera.

Argument type: name is a String.

Retrieves the layer by name. Names are matched by layer name, or source name if there is no layer name. If duplicate
names exist, After Effects uses the first (topmost) one in the Timeline panel. Example:

thisComp.layer("Solid 1")

layer(otherLayer, relIndex)

Return type: Layer, Light, or Camera.

Argument type: otherLayer is a Layer object, and relIndex is a Number.

Retrieves the layer that is relIndex layers above or below otherLayer. For example,

thisComp.layer(thisLayer,

1).active

returns true if the next layer down in the Timeline panel is active.

marker

Return type: MarkerProperty.

Important: You cannot access a composition-time marker by marker number. If you have a project created in a previous
version of After Effects that uses composition marker numbers in expressions, you must change those calls to use

marker.key(name)

instead. Because the default name of a composition-time marker is a number, this is often just a

matter of surrounding the number with quotation marks.

marker.key(index)

Return type: MarkerKey.

Argument type: index is a Number.

Returns the MarkerKey object of the marker with the specified index. The index refers to the order of the marker in
composition time, not to the name of the marker. For example, this expression returns the time of the first compo-
sition-time marker:

thisComp.marker.key(1).time

marker.key(name)

Return type: MarkerKey.

Argument type: name is a String.

Returns the MarkerKey object of the marker with the specified name. The name value is the name of the marker, as
typed in the comment field in the marker dialog box, for example,

marker.key("1")

. For a composition-time

marker, the default name is a number. If more than one marker in the composition has the same name, this method
returns the marker that occurs first in time (in composition time). The value for a marker key is a String, not a
Number. For example, this expression returns the time of the composition-time marker with the name "0":

thisComp.marker.key("0").time

marker.nearestKey(t)

Return type: MarkerKey.

Argument type: t is a Number.