Layer object

app.project.item(index).layer(index)

Description

The Layer object provides access to layers within compositions. It can be accessed from an item’s layer collection either by index number or by a name string.

• Layer is the base class for CameraLayer, LightLayer, and AVLayer, so Layer attributes and methods are available when working with all layer types. See AVLayer object” , “CameraLayer object” , and “LightLayer object”.
Layers contain AE properties, in addition to their JavaScript attributes and methods. For examples of how to access properties in layers,

Example

If the first item in the project is a CompItem, this example disables the first layer in that composition and renames it. This might, for example, turn an icon off in the composition.
var firstLayer = app.project.item(1).layer(1);
firstLayer.enabled = false;
firstLayer.name = "Disabled Layer";
Attributes

Attribute Reference Description
index "Layer index attribute" The index position of the layer.
name "Layer name attribute" The name of the layer.
parent "Layer parent attribute" The parent of this layer.
time "Layer time attribute" The current time of the layer.
startTime "Layer startTime attribute" The start time of the layer.
stretch "Layer stretch attribute" The time stretch percentage of the layer.
inPoint "Layer inPoint attribute" The "in" point of the layer.
outPoint "Layer outPoint attribute" The "out" point of the layer.
enabled "Layer enabled attribute" When true, the layer is enabled.
solo "Layer solo attribute" When true, the layer is soloed.
shy "Layer shy attribute" When true, the layer is shy.
locked "Layer locked attribute" When true, the layer is locked.
hasVideo "Layer hasVideo attribute" When true, the layer contains a video component.
active "Layer active attribute" When true, the layer is active at the current time.
nullLayer "Layer nullLayer attribute" When true, this is a null layer.
selectedProperties "Layer selectedProperties attribute" All selected AE properties in the layer.
comment "Layer comment attribute" A descriptive comment for the layer.
containingComp "Layer containingComp attribute" The composition that contains this layer.

Attribute Reference Description
isNameSet "Layer isNameSet attribute" When true, the layer’s name has been explicitly set.

Methods

Method Reference Description
remove ( ) "Layer remove() method" Deletes the layer from the composition.
moveToBeginning ( ) "Layer moveToBeginning() method" Moves the layer to the top of the composition (makes it the
first layer).
moveToEnd( ) "Layer moveToEnd() method" Moves the layer to the bottom of the composition (makes it
the last layer).
moveAfter() "Layer moveAfter() method" Moves the layer below another layer.
moveBefore () "Layer moveBefore() method" Moves the layer above another layer.
duplicate() "Layer duplicate() method" Duplicates the layer.
copyToComp ( ) "Layer copyToComp() method" Copies the layer to the top (beginning) of another composition.
activeAtTime() "Layer activeAtTime() method" Reports whether this layer will be active at a specified time.
setParentWithJump() "Layer setParentWithJump() method" Sets a new parent for this layer.
applyPreset( ) "Layer applyPreset() method" Applies a named collection of animation settings to the layer.

Other Tags

Posted in Layer object and tagged , , , , , , , , , , , , .