Skip to content

Layer

Layer

Bases: PropertyGroup

The Layer object provides access to layers within compositions.

Info

Layer is a subclass of PropertyGroup, which is a subclass of PropertyBase. All methods and attributes of PropertyGroup, in addition to those listed below, are available when working with Layer objects.

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

active

active: bool

When True, the layer is active at the current time.

Overrides PropertyBase.active to evaluate active_at_time at time.

adjustment_layer

adjustment_layer: bool

True if the layer is an adjustment layer.

Always False for CameraLayer and LightLayer objects. Overridden in AVLayer to read from the binary chunk.

auto_name

auto_name: str

The automatic (display) name derived from match_name.

auto_orient

auto_orient = enum(AutoOrientType, '_ldta', 'auto_orient')

The type of automatic orientation to perform for the layer. Read / Write.

can_set_enabled

can_set_enabled: bool

True if the enabled attribute value can be set.

This is True for all layers, effect property groups, shape vector groups, text path options, and the Layer Styles group and its individual styles. Read-only.

comment

comment: str

A descriptive comment for the layer. Read / Write.

containing_comp

containing_comp: CompItem

The composition that contains this layer. Read-only.

effects

effects: PropertyGroup | None

Contains a layer's effects.

This is the Effects PropertyGroup (match name ADBE Effect Parade). Each child in properties is itself a PropertyGroup representing one effect.

Like ExtendScript's layer.property("Effects"), the group is returned even when it is empty, so the first effect can be added with layer.effects.add_property(...). An empty group is falsy, so if layer.effects: still means "has effects".

None on CameraLayer and LightLayer, the only layer kinds AE gives no Effects group; every other layer kind always has one.

elided

elided: bool

When True, the property is not shown in the UI. An elided property is still present in the timeline but hidden from view. Read-only.

enabled

enabled = bool('_ldta', 'enabled')

When True, the layer is enabled. Overrides PropertyBase.enabled to read from the ldta chunk. Read / Write.

environment_layer

environment_layer: bool

True if the layer is an environment layer.

Always False for CameraLayer and LightLayer objects. Overridden in AVLayer to read from the binary chunk.

essential_property_uuids

essential_property_uuids: list[str] = (
    essential_property_uuids
)

UUIDs of Essential Properties overrides on this layer.

Each UUID corresponds to an EssentialGraphicsController in the source composition's Essential Graphics panel.

frame_in_point

frame_in_point: int

The "in" point of the layer, expressed in composition time (frames). Read / Write.

frame_out_point

frame_out_point: int

The "out" point of the layer, expressed in composition time (frames). Read / Write.

frame_start_time

frame_start_time: int

The start time of the layer, expressed in composition time (frames). Read / Write.

frame_time

frame_time: int

The current time of the layer, expressed in composition time (frames). Read-only.

has_video

has_video: bool

True if the layer has a video switch in the Timeline panel.

Always False for CameraLayer and LightLayer objects.

id

id = ChunkField[int]('_ldta', 'layer_id', read_only=True)

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

in_point

in_point: float

The "in" point of the layer, expressed in composition time (seconds). Read / Write.

On a time-reversed layer the in point is the later end, and sits |stretch| / 100 / 3000 s before the start time (1.2995 s for a -150 % layer starting at 1.3 s), as After Effects reports it.

index

index: int

The 0-based index position of the layer in its containing comp.

Warning

Unlike ExtendScript (1-based), this uses Python's 0-based convention so that comp.layers[layer.index] works directly.

is_3d

is_3d: bool

Whether the layer transforms in three dimensions.

False on the base Layer: only an AVLayer carries the 3D switch, and cameras and lights are always 3D, so both override this. Read-only.

is_effect

is_effect: bool

When True, this property is an effect PropertyGroup. Read-only.

is_mask

is_mask: bool

When True, this property is a mask PropertyGroup. Read-only.

is_modified

is_modified: bool

True if any child property is modified.

For indexed groups (such as Effects or Masks parades), the group is considered modified when it has any children - adding items to an indexed group is itself a modification. Shape vector groups (value) follow the same rule.

is_name_set

is_name_set: bool

True if the name has been explicitly set by the user. Read-only.

label

label = enum(Label, '_ldta', '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). Read / Write.

layer_type

layer_type: str

The type of layer. Matches ExtendScript layerType values: "AVLayer", "LightLayer", "CameraLayer", "ParametricMeshLayer", or "Layer". Read-only.

locked

locked = bool('_ldta', 'locked')

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

marker

marker: Property | None

The layer's marker property.

A Property with match_name="ADBE Marker" whose keyframes hold marker values. None when the layer has no markers.

markers

markers: list[MarkerValue]

A flat list of MarkerValue objects for this layer.

Shortcut for accessing marker data without navigating the property tree. Returns an empty list when the layer has no markers.

Example
for marker in layer.markers:
    print(marker.comment)

masks

masks: PropertyGroup | None

Contains a layer's masks.

This is the Masks PropertyGroup (match name ADBE Mask Parade). Each child in properties is itself a PropertyGroup representing one mask.

Like effects, the group is returned even when it is empty (an empty group is falsy), and is None only on CameraLayer and LightLayer, which AE gives no Masks group.

match_name

match_name: str

A special name for the property used to build unique naming paths. The match name is not displayed, but you can refer to it in scripts. Every property has a unique match-name identifier. Read-only.

name

name: None

null_layer

null_layer = ChunkField[bool](
    "_ldta", "null_layer", read_only=True
)

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

num_properties

num_properties: int

The number of child properties in this group.

Equivalent to ExtendScript PropertyGroup.numProperties.

out_point

out_point: float

The "out" point of the layer, expressed in composition time (seconds). Read / Write.

On a time-reversed layer the out point is the earlier end (see in_point).

parent

parent: Layer | None

The parent of this layer; can be None.

Offset values are calculated to counterbalance any transforms above this layer in the hierarchy, so that when you set the parent there is no apparent jump in the layer's transform.

For example, if the new parent has a rotation of 30 degrees, the child layer is assigned a rotation of -30 degrees.

Like After Effects, the offsets are computed from the transforms at the composition's current time, and a parent scaled to 0 is set without any offset.

To set the parent without changing the child layer's transform values, use the set_parent_with_jump method.

Read / Write.

parent_property

parent_property: PropertyGroup | None

The parent PropertyGroup of this property, or None for top-level layer property groups. Read-only.

properties

properties: list[Property | PropertyGroup]

List of properties in this group. Read-only.

property_depth

property_depth: int

The number of levels of parent groups between this property and the containing layer. The value is 0 for a layer. Read-only.

property_index

property_index: int | None

The 0-based position of this property within its parent group.

Returns None for layers (property depth 0).

Warning

Unlike ExtendScript (1-based), this uses Python's 0-based convention so that group.properties[prop.property_index] works directly.

Read-only.

property_type

property_type: PropertyType

The type of this property. One of PropertyType.PROPERTY, PropertyType.NAMED_GROUP, or PropertyType.INDEXED_GROUP. Read-only.

selected

selected: bool

When True, the property is selected. Read / Write.

Note

Property selection is stored in the .aep binary format but very complex. Parsed projects report False for now.

shy

shy = bool('_ldta', 'shy')

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. Read / Write.

solo

solo = bool('_ldta', 'solo')

When True, the layer is soloed. Read / Write.

start_time

start_time: float

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

Writing snaps the time to the nearest tick of the layer's own timebase (see stretch), a tie rounding up, as After Effects does: on AE 2026, 1.3 s on a 24 fps layer reads back as 1.3000081 s (31949 / 24576) and on a 150 % one as 1.2999946 s (47923 / 36864). A later stretch change leaves the stored start alone.

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. Read / Write.

Writing also rescales every keyframe on the layer. A layer counts its keyframe ticks against its own timebase, comp internal_timebase * max(1, |stretch| / 100) (at most 115200 ticks a second), so stretching it while leaving the counts alone would halve or double each keyframe's position in LAYER time. After Effects keeps them fixed there and rescales the counts (measured on AE 2026: a key at layer-second 1 on a 24 fps comp holds 24576 ticks, and 49152 after the layer is stretched to 200 %, where its composition time becomes 2 s).

The stretch is stored as AE writes it, a float32 of the percentage / 100: 133.33 reads back as 133.32999944686890. A value under 1 (0 included) becomes the smallest stretch AE stores, 655 / 65536, which reads back as 0.99945068359375 (with the sign of a negative value), as on AE 2026. AE refuses more than 9900 % from a script but opens a file holding 1000000 %; py_aep accepts any stretch the file's signed 32-bit ratio can hold.

text

text: PropertyGroup | None

Contains a layer's text properties.

This is the Text PropertyGroup (match name ADBE Text Properties), holding Source Text, Path Options, More Options and the Animators.

None on every layer that is not a TextLayer: unlike effects and masks, this group is never synthesized for other layer kinds because AE does not expose it on them.

time

time: float

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

transform

transform: PropertyGroup

Contains a layer's transform properties.

This is the Transform PropertyGroup (match name ADBE Transform Group). Individual transform properties (Position, Scale, Rotation, etc.) are accessible via properties.

Functions

active_at_time

active_at_time(time: float) -> bool

Return whether the layer is active at the given time.

For this method to return True, three conditions must be met:

  1. The layer must be enabled.
  2. No other layer in the containing_comp may be soloed unless this layer is also solo.
  3. time must fall between in_point (inclusive) and out_point (exclusive).

Parameters:

  • time (float) –

    The time in seconds.

add_property

add_property(name: str) -> Property | PropertyGroup

Create and return a new property with the specified name, and add it to this group.

Indexed groups (and, as a named-group exception, the text animator Properties pool) support adding properties; see can_add_property. Accepted names cover every ExtendScript addable family: mask atoms (ADBE Mask Atom / Mask), the expression controls including the Dropdown Menu Control (e.g. ADBE Slider Control / Slider Control, ADBE Dropdown Control), shape elements on a contents group (e.g. ADBE Vector Shape - Rect, ADBE Vector Group), text selectors (e.g. ADBE Text Selector / Range Selector), text animators (ADBE Text Animator / Animator), and animator properties from the fixed pool (e.g. ADBE Text Position 3D / Position).

Note

Unlike ExtendScript, adding a property does not invalidate existing references to the group's other properties.

Parameters:

  • name (str) –

    The display name or match name of the property to add.

Raises:

  • ValueError –

    If a property with this name cannot be added to this group.

add_variable_font_axis

add_variable_font_axis(
    axis_tag: str, font_file: str | None = None
) -> Property

Create and return a Property for a variable font axis, and add it to this group.

Mirrors ExtendScript PropertyGroup.addVariableFontAxis(). Can only be called on the ADBE Text Animator Properties group within a text animator. The axis binds to the first free of the 8 ADBE Text VF Axis slots; calling it again with an already active tag returns the existing property.

The axis bounds, default value, and display name are read from the variable font file with fontTools (After Effects reads them from the installed font; the project file does not store a font path). Pass font_file explicitly, or leave it None to locate the installed font from the text document's font family.

Note

This functionality was added in After Effects 26.0.

Parameters:

  • axis_tag (str) –

    The 4-character tag identifying the variable font axis (e.g. wght, wdth, slnt, ital, opsz).

  • font_file (str | None, default: None ) –

    Optional path to the variable font file. When None, the font is located in the OS font directories by the text document's font family.

Raises:

  • ValueError –

    If this group is not a text animator Properties group, the font cannot be located or is not a variable font, axis_tag is not one of the font's axes, or all 8 axis slots are in use.

can_add_property

can_add_property(name: str) -> bool

Check whether a property with the given name can be added.

Returns True if this group is an indexed group and name is a valid match name or display name for the group type. For the Effect Parade, the expression controls py_aep can create plus any effect already defined in the project (LIST:EfdG) are accepted.

Parameters:

  • name (str) –

    A match name or display name to check.

copy_to_comp

copy_to_comp(into_comp: CompItem) -> Layer

Copy this layer into a composition, as After Effects' copyToComp() does.

The copy is placed at the top of the target layer stack. Its parent is cleared and its transform rewritten so it keeps its place (the parent's transform at time 0 is baked in, whatever the playhead), and the layers its effects reference are cleared - also when the target is this layer's own containing_comp (use duplicate to keep them). Into another composition the track matte and an environment light's source are cleared too, and keyframe and marker times are kept in seconds whatever the target's frame rate (measured on AE 2026).

Parameters:

Returns: The newly created Layer in the target composition.

duplicate

duplicate() -> Layer

Create a duplicate of this layer in the same composition.

The duplicate is placed directly above (before) the original layer.

Returns:

move_after

move_after(layer: Layer) -> None

Moves this layer to a position immediately after (below) the specified layer.

Parameters:

  • layer (Layer) –

    The target layer in the same composition.

move_before

move_before(layer: Layer) -> None

Moves this layer to a position immediately before (above) the specified layer.

Parameters:

  • layer (Layer) –

    The target layer in the same composition.

move_to

move_to(new_index: int) -> None

Move this property to a new 0-based index within its parent group.

Only valid for children of indexed groups.

Parameters:

  • new_index (int) –

    The target 0-based position.

Raises:

  • ValueError –

    If this property is not in an indexed group.

  • IndexError –

    If new_index is out of range.

move_to_beginning

move_to_beginning() -> None

Moves this layer to the topmost position of the composition.

move_to_end

move_to_end() -> None

Moves this layer to the bottommost position of the composition.

property

property(key: int | str) -> Property | PropertyGroup

Look up a child property by index or name.

Parameters:

  • key (int | str) –

    An int index or a str display name / match name.

remove

remove() -> None

Deletes this layer from the composition.

Layers that reference this layer as a parent become unparented (their transforms are recalculated to preserve world-space appearance). AVLayers that use this layer as a track matte lose their matte reference.

remove_all_keys

remove_all_keys() -> None

Remove every keyframe from all properties in this group, recursively.

Calling this on a Layer clears the keyframes of every property on the layer, including its marker keyframes. Each animated property reverts to a static value; see Property.remove_all_keys.

remove_all_markers

remove_all_markers() -> None

Remove all markers from this layer.

A no-op when the layer has no markers.

set_parent_with_jump

set_parent_with_jump(new_parent: Layer | None) -> None

Sets the parent of this layer to the specified layer, without changing the transform values of the child layer.

There may be an apparent jump in the rotation, translation, or scale of the child layer, as this layer's transform values are combined with those of its ancestors.

If you do not want the child layer to jump, set the parent attribute directly. In this case, an offset is calculated and set in the child layer's transform fields, to prevent the jump from occurring.

Parameters:

  • new_parent (Layer | None) –

    The new parent layer, or None to unparent.

Raises:

  • ValueError –

    If new_parent is this layer itself, one of its descendants, or a layer in another composition.