beautypg.com

Adobe After Effects CS4 User Manual

Page 674

background image

668

USING AFTER EFFECTS CS4

Expressions

Last updated 12/21/2009

thisComp.marker.nearestKey(time).time

marker.numKeys

Return type: Number.

Returns the total number of composition markers in the composition.

numLayers

Return type: Number.

Returns the number of layers in the composition.

activeCamera

Return type: Camera.

Returns the Camera object for the camera through which the composition is rendered at the current frame. This
camera is not necessarily the camera through which you are looking in the Composition panel.

width

Return type: Number.

Returns the composition width, in pixels.

Apply the following expression to the Position property of a layer to center the layer in the composition frame:

[thisComp.width/2, thisComp.height/2]

height

Return type: Number.

Returns the composition height, in pixels.

duration

Return type: Number.

Returns the composition duration, in seconds.

displayStartTime

Return type: Number.

Returns the composition start time, in seconds.

frameDuration

Return type: Number.

Returns the duration of a frame, in seconds.

shutterAngle

Return type: Number.

Returns the shutter-angle value of the composition, in degrees.

shutterPhase

Return type: Number.

Returns the shutter phase of the composition, in degrees.

bgColor

Return type: Array [4].

Returns the background color of the composition.

pixelAspect

Return type: Number.

Returns the pixel aspect ratio of the composition.

name

Return type: String.

Returns the name of the composition.

Footage attributes and methods (expression reference)

To use a footage item from the Project panel as an object in an expression, use the global

footage

method, as in

footage("file_name")

. You can also access a footage object using the

source

attribute on a layer whose source is a

footage item.

width

Return type: Number.

This manual is related to the following products: