Skip to content

global

These attributes and methods are global, top-level elements accessible from any expression across your project. They’re among the most commonly-used expression elements.


colorDepth

Type the project color depth value.

For example, colorDepth returns 16 when the project color depth is 16 bits per channel.

Number


thisComp

Represents the composition containing the expression.

Comp


thisLayer

Represents the layer containing the expression.

Because thisLayer is the default object, its use is optional.

For example, you can start an expression with thisLayer.width or width and get the same result.

Layer, Light, or Camera object


thisProject

Represents the project which contains the expression.

Project


thisProperty

Represents the property containing the expression.

For example, if you write an expression on the Rotation property, you can start an expression with thisProperty to refer to the Rotation property.

Property


time

Represents the composition time, in seconds, at which the expression is being evaluated.

Number


value

Represents the value at the current time for the property containing the expression.

A value of the same property type as the property being refrenced.


comp(name)

Retrieves another composition by name.

ParameterTypeDescription
nameStringThe name of the composition to get

Comp


footage(name)

Retrieves a footage item by name.

ParameterTypeDescription
nameStringThe name of the footage item to get

Footage


posterizeTime(updatesPerSecond)

This expression allows you to set the frame rate for a property to be lower than the frame rate of the composition.

ParameterTypeDescription
updatesPerSecondNumberThe number of times per second the expression should evaluate

Number

To change a property to a random value 1 time per second:

posterizeTime(1);
random()

To change a 2d property (such as Position or Scale) to a random value 3 times per second:

posterizeTime(3);
const newValue = random(0, 100);
[newValue, newValue];

To change a property to a random value within a specified range, every 12 frames:

const holdFrames = 12;
const minValue = 50;
const maxValue = 100;
posterizeTime(1 / framesToTime(holdFrames));
const newValue = random(minValue, maxValue);
newValue;