Skip to content

Layer

Layer

Layer(
    auto_orient: AutoOrientType,
    comment: str,
    containing_comp: CompItem,
    effects: list[PropertyGroup],
    enabled: bool,
    frame_in_point: int,
    frame_out_point: int,
    frame_start_time: int,
    id: int,
    in_point: float,
    label: Label,
    layer_type: str,
    locked: bool,
    markers: list[MarkerValue],
    name: str,
    null_layer: bool,
    out_point: float,
    _parent_id: int,
    start_time: float,
    shy: bool,
    solo: bool,
    stretch: float,
    text: PropertyGroup | None,
    time: float,
    transform: list[Property],
)

Bases: ABC

The Layer object provides access to layers within compositions.

Warning

In the ExtendScript API, Layer is a subclass of PropertyGroup, which is a subclass of PropertyBase. It is not the case here at the moment.

Info

Layer is the base class for CameraLayer object, LightLayer object and AVLayer object, so Layer attributes and methods are available when working with all layer types.

See: https://ae-scripting.docsforadobe.dev/layer/layer/

Attributes

auto_orient

auto_orient: AutoOrientType

The type of automatic orientation to perform for the layer.

comment

comment: str

A descriptive comment for the layer.

containing_comp

containing_comp: CompItem = field(repr=False)

The composition that contains this layer. Set after parsing when the full project structure is available.

effects

effects: list[PropertyGroup]

Contains a layer's effects (if any).

enabled

enabled: bool

Corresponds to the video switch state of the layer in the Timeline panel.

frame_in_point

frame_in_point: int

The "in" point of the layer, expressed in composition time (frames). This is the first frame where the layer becomes visible. The binary format stores this relative to start_time; parsed value is absolute composition time.

frame_out_point

frame_out_point: int

The "out" point of the layer, expressed in composition time (frames). This is the first frame where the layer is no longer visible. Clamped to composition duration to match ExtendScript behavior.

frame_start_time

frame_start_time: int

The start time of the layer, expressed in composition time (frames). This determines where the layer's first frame of content appears in the composition timeline.

id

id: int

Unique and persistent identification number used internally to identify a Layer between sessions.

in_point

in_point: float

The "in" point of the layer, expressed in composition time (seconds). This is the time at which the layer starts being visible in the composition. The binary format stores this relative to start_time as a signed integer; parsed value is absolute composition time.

is_name_set

is_name_set: bool = field(init=False)

label

label: Label

The label color. Colors are represented by their number (0 for None, or 1 to 16 for one of the preset colors in the Labels preferences).

layer_type

layer_type: str

The type of layer (footage, light, camera, text, shape).

locked

locked: bool

When True, the layer is locked. This corresponds to the lock toggle in the Layer panel.

markers

markers: list[MarkerValue]

Contains a layer's markers.

name

name: str

The name of the layer.

null_layer

null_layer: bool

When True, the layer was created as a null object.

out_point

out_point: float

The "out" point of the layer, expressed in composition time (seconds). This is the time at which the layer stops being visible in the composition. Clamped to composition duration to match ExtendScript API behavior (a layer's out_point cannot exceed its containing composition's duration). The binary format stores this relative to start_time.

parent

parent: Layer | None

The parent layer for layer parenting. None if no parent.

shy

shy: bool

When True, the layer is "shy", meaning that it is hidden in the Layer panel if the composition's "Hide all shy layers" option is toggled on.

solo

solo: bool

When True, the layer is soloed.

start_time

start_time: float

The start time of the layer, expressed in composition time (seconds).

stretch

stretch: float

The layer's time stretch, expressed as a percentage. A value of 100 means no stretch. Values between 0 and 1 are set to 1, and values between -1 and 0 (not including 0) are set to -1.

text

text: PropertyGroup | None

Contains a layer's text properties (if any).

time

time: float

The current time of the layer, expressed in composition time (seconds).

transform

transform: list[Property]

Contains a layer's transform properties.