Camera layer
CameraLayer
¶
Bases: Layer
The CameraLayer object represents a camera layer within a composition.
Example
Info
CameraLayer is a subclass of Layer object. All methods and
attributes of Layer are available when working with CameraLayer.
See: https://ae-scripting.docsforadobe.dev/layer/cameralayer/
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_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, and text path options. 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. None when the layer has no
effects.
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 = ChunkField[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
¶
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.
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_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.
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", or "Layer".
Read-only.
locked
¶
locked = ChunkField[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.
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. Read-only.
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.
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.
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 = ChunkField[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.
start_time
¶
start_time = ChunkField[float]('_ldta', 'start_time')
The start time of the layer, expressed in composition time (seconds). Read / Write.
stretch
¶
stretch = ChunkField[float]('_ldta', 'stretch')
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.
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
¶
Return whether the layer is active at the given time.
For this method to return True, three conditions must be met:
- The layer must be
enabled. - No other layer in the containing_comp may be soloed unless this layer is also solo.
timemust fall between in_point (inclusive) and out_point (exclusive).
Parameters:
-
time(float) –The time in seconds.
can_add_property
¶
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, any non-empty string is accepted (actual
effect availability is validated at add time).
Parameters:
-
name(str) –A match name or display name to check.
copy_to_comp
¶
Copy this layer into another composition.
If the target is the same as this layer's containing_comp, the copy behaves like duplicate: it is placed directly above the original and preserves parent and track matte references.
If the target is a different composition, the copy is placed at the top of the target layer stack and parent and track matte references are cleared.
Parameters:
Returns: The newly created Layer in the target composition.
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_indexis out of range.
move_to_beginning
¶
Moves this layer to the topmost position of the composition.
property
¶
property(key: int | str) -> Property | PropertyGroup
remove
¶
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.
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
Noneto unparent.