DuAEF.DuAE.Comp

After Effects composition methods

Methods

static addAdjustmentLayer(comp) → {AVLayer}

Creates a new Adjustment layer
Parameters:
Name Type Description
comp CompItem The comp
Returns:
AVLayer - The layer.

static doLayers(method, undoGroupNameopt, compopt)

Runs a function on all the layers
Parameters:
Name Type Attributes Description
method function The function to run on the layers, which takes a layer as its only argument.
undoGroupName string <optional>
The name of the undoGroup created before the execution. If not provided, there will not be any undoGroup created.
comp CompItem <optional>
The comp containing the layers. Will use the current comp if not provided.

static doSelectedLayers(method, undoGroupNameopt)

Runs a function on all the selected layers
Parameters:
Name Type Attributes Description
method function The function to run on the layers, which takes a layer as its only argument.
undoGroupName string <optional>
The name of the undoGroup created before the execution. If not provided, there will not be any undoGroup created.

static getAnimatedProps(filteropt, strictopt, caseSensitiveopt, selectedLayersOnlyopt, compopt) → {Array.<PropertyInfo>}

Gets the After Effects animated (with keyframes) properties in the current comp
Parameters:
Name Type Attributes Default Description
filter PropertyType | PropertyValueType | string | function <optional>
A filter to get only a certain type, or value type, or property name or matchName.
A function which take one PropertyBase as argument can be used to filter the properties: the Property will be returned if the function returns true.
strict boolean <optional>
false If a string filter is provided, wether to search for the exact name/matchName or if it contains the filter.
caseSensitive boolean <optional>
true If a string filter is provided, and not strict is false, does the search have to be case sensitive?
selectedLayersOnly boolean <optional>
false True to get the properties on the selected layers only
comp CompItem <optional>
DuAEF.DuAE.Project.getActiveComp The composition
Returns:
Array.<PropertyInfo> - The selected properties, an empty Array if nothing active or selected

static getAudioLayers(comp, audioActiveOnlyopt) → {Array.<AVLayer>}

Gets all the layers with audio in the composition
Parameters:
Name Type Attributes Default Description
comp CompItem The composition where the audio will be searched
audioActiveOnly bool <optional>
false If true, does not get muted layers.
Returns:
Array.<AVLayer> - An array of AVLayer containing the audio layers

static getParentComps(item) → {Array.<CompItem>}

Recursively gets all compositions where this item is used
Parameters:
Name Type Description
item AVItem The item
Returns:
Array.<CompItem> - The compositions

static getPrecomps(comp, recursiveopt) → {Array.<CompItem>}

Gets all the precomposition found in the comp.
Parameters:
Name Type Attributes Default Description
comp CompItem The composition
recursive bool <optional>
false True to get nested compositions
Returns:
Array.<CompItem> - The precompositions

static getRelatives(compopt, recursiveopt) → {Array.<CompItem>}

Gets all precomps and parent comps of the composition
Parameters:
Name Type Attributes Default Description
comp CompItem <optional>
DuAEF.DuAE.Project.getActiveComp() The composition
recursive bool <optional>
false True to search to more than one level of precomposition
Returns:
Array.<CompItem> - The related compositons

static getSelectedLayers() → {Array.<Layer>}

Gets the selected layers in the current comp
Returns:
Array.<Layer> - The selected layers

static getSelectedProps(filteropt, strictopt, caseSensitiveopt) → {Array.<PropertyInfo>}

Gets the After Effects selected properties in the current comp
Parameters:
Name Type Attributes Default Description
filter PropertyType | PropertyValueType | string | function <optional>
A filter to get only a certain type, or value type, or property name or matchName.
A function which take one PropertyBase as argument can be used to filter the properties: the Property will be returned if the function returns true.
strict boolean <optional>
false If a string filter is provided, wether to search for the exact name/matchName or if it contains the filter.
caseSensitive boolean <optional>
true If a string filter is provided, and not strict is false, does the search have to be case sensitive?
Returns:
Array.<PropertyInfo> - The selected properties, an empty Array if nothing active or selected

static newUniqueLayerName(newName, comp, incrementopt) → {string}

Generates a new unique name for a layer
Parameters:
Name Type Attributes Default Description
newName string The wanted new name
comp CompItem The comp
increment boolean <optional>
true true to automatically increment the new name if it already ends with a digit
Returns:
string - The unique name, with a new number at the end if needed.

static newUniqueMarkerName(newName, comp, incrementopt) → {string}

Generates a new unique name for a marker for this comp
Parameters:
Name Type Attributes Default Description
newName string The wanted new name
comp CompItem The comp
increment boolean <optional>
true true to automatically increment the new name if it already ends with a digit
Returns:
string - The unique name, with a new number at the end if needed.

static parentAllOrphans(layer, includeLockedLayersopt)

Links all orphan layers in the comp to a layer
Parameters:
Name Type Attributes Default Description
layer Layer The parent layer
includeLockedLayers bool <optional>
false True to parent layers even if they are locked

static replaceInExpressions(oldString, newString, compopt, caseSensitiveopt, selectedLayersopt)

Replaces text in Expressions
Parameters:
Name Type Attributes Default Description
oldString string The string to replace
newString string The new string
comp CompItem <optional>
DuAEF.DuAE.Project.getActiveComp() The comp with expressions to cache
caseSensitive boolean <optional>
true Wether the search has to be case sensitive
selectedLayers boolean <optional>
false Set to true to cache only selected layers.

static selectLayers(layers)

Selects the layers
Parameters:
Name Type Description
layers Array.<Layer> The layers

static setUniqueCompName(comp) → {string}

Makes sure the composition has a unique name, renaming it if needed.
Parameters:
Name Type Description
comp CompItem The composition
Returns:
string - The new name.

static unselectLayers(compopt) → {Array.<Layer>}

Deselects all layers in a composition
Parameters:
Name Type Attributes Default Description
comp CompItem <optional>
app.project.activeItem The composition
Returns:
Array.<Layer> - The previously selected layers.
A custom attribute, Layer.props is added on each layer object which is an array of all previously selected properties as PropertyInfo objects

static unselectProperties()

Deselects all properties in the current composition

static updateExpressionCache(compopt, selectedLayersopt)

Updates the cache of the expressions used by Duik to speed up batch process of expressions in the whole project.
It's automatically run when needed if it's not been updated in a long time (1 mn) or if it's empty
Parameters:
Name Type Attributes Default Description
comp CompItem <optional>
DuAEF.DuAE.Project.getActiveComp() The comp with expressions to cache
selectedLayers boolean <optional>
false Set to true to cache only selected layers.