Skip to content

Light Layer

LightLayer

LightLayer(
    enabled: bool,
    match_name: str,
    name: str,
    property_depth: int,
    properties: list[Property | PropertyGroup],
    auto_orient: AutoOrientType,
    comment: str,
    containing_comp: CompItem,
    frame_in_point: int,
    frame_out_point: int,
    frame_start_time: int,
    id: int,
    in_point: float,
    label: Label,
    layer_type: str,
    locked: bool,
    null_layer: bool,
    out_point: float,
    _parent_id: int,
    start_time: float,
    shy: bool,
    solo: bool,
    stretch: float,
    time: float,
    light_type: LightType,
    _light_source_id: int,
    light_source: Layer | None = None,
)

Bases: Layer

The LightLayer object represents a light layer within a composition.

Example
from aep_parser import parse

app = parse("project.aep")
comp = app.project.compositions[0]
light = comp.light_layers[0]
print(light.light_type)
Info

LightLayer is a subclass of Layer object. All methods and attributes of Layer are available when working with LightLayer.

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

Attributes

active

active: bool

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

Overrides PropertyBase.active to evaluate active_at_time at time.

auto_orient

auto_orient: AutoOrientType

The type of automatic orientation to perform for the layer.

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, and text path options.

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: 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. None when the layer has no effects.

elided

elided: bool = field(init=False, default=False)

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

enabled

enabled: bool

Corresponds to the setting of the eyeball icon.

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.

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: 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.

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_effect

is_effect: bool = field(init=False, default=False)

When True, this property is an effect PropertyGroup.

is_mask

is_mask: bool = field(init=False, default=False)

When True, this property is a mask PropertyGroup.

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.

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. Matches ExtendScript layerType values: "AVLayer", "LightLayer", "CameraLayer", or "Layer".

light_source

light_source: Layer | None = field(default=None, repr=False)

The layer used as a light source when light_type is LightType.ENVIRONMENT. Returns None if no source is assigned.

Warning

Added in After Effects 24.3.

light_type

light_type: LightType

The type of light.

locked

locked: bool

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

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. None when the layer has no masks.

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.

name

name: str

Display name of the property.

null_layer

null_layer: bool

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

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). 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.

parent_property

parent_property: PropertyGroup | None = field(
    init=False, default=None, repr=False
)

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

properties

properties: list[Property | PropertyGroup]

List of properties in this group.

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.

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.

property_type

property_type: PropertyType = field(
    init=False, default=NAMED_GROUP
)

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

selected

selected: bool = field(init=False, default=False)

When True, the property is selected.

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: 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.

property

property(
    index: int | None = None, name: str | None = None
) -> Property | PropertyGroup

Find and return a child property of this group.

The property can be specified by either its index or name (match name or display name).

Parameters:

  • index
    (int | None, default: None ) –

    The index of the property to return.

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

    The name of the property to return.