add()

app.project.item(index).layers.add(item,duration)

Description

Creates a new AVLayer object containing the specified item, and adds it to this collection.
The new layer honors the Create Layers at Composition Start Time preference.
This method generates an exception if the item cannot be added as a layer to this CompItem.

Parameters

item The AVItem object for the item to be added.
duration Optional, the length of a still layer in seconds, a floating-point value. Used only if the item contains a piece of still footage. Has no effect on movies, sequences or audio.
If supplied, sets the duration value of the new layer. Otherwise, the duration value is set according to user preferences. By default, this is the same as the duration of the containing CompItem. To set another preferred value, choose Edit > Preferences > Import (Windows) or After Effects > Preferences > Import (Mac OS), and specify options under Still Footage.

Returns

AVLayer object.

Other Tags

Posted in LayerCollection object and tagged , , , , , , , , , , , , , , .