MANUAL / SCRIPTING & EXPRESSIONS

Layers, comp and properties (expressions)

Reaching layers, the comp, transform properties and effect parameters from an expression.

The comp

thisComp.layer("Name") or thisComp.layer(1) (1-based, top first) returns a layer.

MemberWhat it is
thisComp.width, thisComp.heightComp size in pixels.
thisComp.durationSeconds.
thisComp.frameDurationSeconds per frame.
thisComp.numLayers
thisComp.name

Layers

MemberWhat it is
nameThe layer's name.
index1-based.
inPoint, startTimeThe layer's in point, seconds.
outPointSeconds.
hasParenttrue/false.
parentThe parent layer.
transformThe Transform group.
position, scale, rotation, opacity, anchorPointTransform properties (also under transform.).
effect("Name")An effect on the layer, by name.

On the expression's own layer these can be used bare: index, position, effect("Slider Control")("Slider").

Properties expressions can read

position, xPosition, yPosition, anchorPoint, scale, rotation (also zRotation), opacity, the shape and text values Drivers can reach, and effect parameters via effect("Name")("Param").

A property used in arithmetic reads as its value now. Members:

MemberWhat it is
.valueThe value now.
.valueAtTime(t)The keyframed value at t seconds.
.numKeysKeyframe count.
.loopOut(type, n), .loopIn(type, n)See Looping and time.

Effects

effect("Bounce")("Slider")
thisComp.layer("Controls").effect("Angle Control")("Angle")

A parameter can be named by string or number. Effects are found by their name in the layer's effect stack — rename them to make expressions readable.

Examples

// follow another layer
thisComp.layer("Null 1").transform.position

// offset copies by their index
value + [index * 40, 0]

// rotate from a slider
effect("Speed")("Slider") * time

Notes

  • A property that has its own expression is evaluated first, then read.
  • .valueAtTime() at another time reads the keyframed value before modifiers. At the current time, every read is the fully resolved value.