Namespace

DuAELayer

DuAELayer

After Effects layer methods

View Source Duik_api_fordoc.jsxinc, line 30848

Methods

# static addNull(layer) → {Layer}

Adds a new Null object just above a layer, at the same position.
This is a convenience function calling DuAEComp.addNull.
Parameters:
Name Type Description
layer Layer The layer

View Source Duik_api_fordoc.jsxinc, line 31799

the null
Layer

# static addPseudoEffect(layer, preset, matchName, nameopt) → {PropertyGroup|null}

This method is a workaround to AE API method layer.applyPreset to work like addProperty when adding pseudoEffects
Parameters:
Name Type Attributes Description
layer Layer The layer
preset File The preset file
matchName string The pseudo Effect matchName.
name string <optional>
The name to set on the effect

View Source Duik_api_fordoc.jsxinc, line 31495

The effect or null if anything went wrong
PropertyGroup | null

# static align(layers, target, positionopt, rotationopt, scaleopt, opacityopt)

Aligns the layers' transformations (position, rotation, scale) to another layer
Parameters:
Name Type Attributes Default Description
layers Array.<Layer> | LayerCollection The layers to align.
target Layer The reference layer.
position boolean <optional>
true True to align position.
rotation boolean <optional>
true True to align orientation.
scale boolean <optional>
true True to align scale.
opacity boolean <optional>
false True to align opcacity.

View Source Duik_api_fordoc.jsxinc, line 32037

# static alignOpacity(layer, target)

Aligns a layer's opcaity to another layer
Parameters:
Name Type Description
layer Layer The layer to align.
target Layer The reference layer.

View Source Duik_api_fordoc.jsxinc, line 32020

# static alignOrientation(layer, target)

Aligns a layer's orientation to another layer
Parameters:
Name Type Description
layer Layer The layer to align.
target Layer The reference layer.

View Source Duik_api_fordoc.jsxinc, line 31976

# static alignPosition(layer, target)

Aligns a layer in position to another layer
Parameters:
Name Type Description
layer Layer The layer to align.
target Layer The reference layer.

View Source Duik_api_fordoc.jsxinc, line 31939

# static alignScale(layer, target)

Aligns a layer's scale to another layer
Parameters:
Name Type Description
layer Layer The layer to align.
target Layer The reference layer.

View Source Duik_api_fordoc.jsxinc, line 31998

# static angleFromLayers(angleLayer, oppositeLayerA, oppositeLayerB) → {Number}

Finds the angle formed by three layers
Parameters:
Name Type Description
angleLayer Layer The layer at which to measure the angle
oppositeLayerA Layer One of the opposite layers
oppositeLayerB Layer The other opposite layer

View Source Duik_api_fordoc.jsxinc, line 32841

The angle in degrees. This is an oriented angle (the value can be negative).
Number

# static applyPreset(layer, preset, matchName) → {PropertyGroup|null}

Adds an animation preset on the layer.
Be careful as layer selection will be kept but not properties selection,
and this can result in an "invalid object" if referencing a property.
Parameters:
Name Type Description
layer Layer The layer
preset File The preset file
matchName string The pseudo Effect matchName

View Source Duik_api_fordoc.jsxinc, line 31458

The effect corresponding matchName or null if anything went wrong
PropertyGroup | null

# static autoDuration(layer, preExpressionopt)

Sets the In and Out points of a layer according to its opacity (cuts at 0%)
Parameters:
Name Type Attributes Default Description
layer Layer The layer
preExpression boolean <optional>
false Whether to check for the opacity post or pre-expression value

View Source Duik_api_fordoc.jsxinc, line 32147

# static bake(layer, modeopt, frameStepopt)

Bakes the expressions to keyframes and removes all non-renderable layers.
Parameters:
Name Type Attributes Default Description
layer Layer The layer to bake.
mode DuAEExpression.BakeAlgorithm <optional>
DuAEExpression.BakeAlgorithm.SMART The algorithm to use for baking the expressions.
frameStep Number <optional>
1.0 By default, checks one value per keyframe. A lower value increases the precision and allows for sub-frame sampling. A higher value is faster but less precise.

View Source Duik_api_fordoc.jsxinc, line 32644

# static copyToComp(layers, destinationComp, withPropertyLinksopt) → {Array.<Layer>}

Copies the layers to another comp
Parameters:
Name Type Attributes Default Description
layers Array.<Layer> The layers to copy and paste
destinationComp CompItem The composition to copy to
withPropertyLinks boolean <optional>
false Add expressions on the properties to link them to the orriginal layers
Works only on 12.0 and above, ignored on 11.0 (CS6) and below

View Source Duik_api_fordoc.jsxinc, line 31819

The new layers
Array.<Layer>

# static createLocator(layerOrCompopt) → {ShapeLayer}

Creates a new locator linked to the layer
Parameters:
Name Type Attributes Description
layerOrComp Layer | CompItem <optional>
The layer or the containing comp

View Source Duik_api_fordoc.jsxinc, line 32507

The locator
ShapeLayer

# static doLayers(method, undoGroupNameopt)

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.

View Source Duik_api_fordoc.jsxinc, line 30969

Gets an expression linking to the layer
Parameters:
Name Type Attributes Default Description
layer Layer The layer
useThisComp Boolean <optional>
false Whether to begin the expression by 'thisComp' or 'comp("name")'

View Source Duik_api_fordoc.jsxinc, line 32198

The expression link to the layer
str

# static firstKeyFrameTime(layer, selected) → {float|null}

Gets the time of the first keyFrame
Parameters:
Name Type Description
layer Array.<Layer> | LayerCollection The layer
selected boolean true to check selected keyframes only

View Source Duik_api_fordoc.jsxinc, line 31560

The keyframe time or null if there are no keyframe
float | null

# static getActiveProperty(layer) → {DuAEProperty|null}

Gets the After Effects active property (the last selected one)
Parameters:
Name Type Description
layer Layer The layer

View Source Duik_api_fordoc.jsxinc, line 31076

The selected property, or null if there isn't any.
DuAEProperty | null

# static getAnim(layer, selectedopt, timeRangeopt) → {DuAELayerAnimation}

Gets all animations on the layer in the whole timeline or in the time range
The first DuAEKeyframe._time will be adjusted relatively to the start of the time range (if provided) instead of the startTime of the composition.
Parameters:
Name Type Attributes Default Description
layer Layer The layer.
selected Boolean <optional>
false true to get only selected keyframes.
timeRange Array.<float> <optional>
The time range, an array of two time values, in seconds.

View Source Duik_api_fordoc.jsxinc, line 31091

The animation.

# static getAnims(layers, selectedopt, timeRangeopt) → {Array.<DuAELayerAnimation>}

Gets all animations on the layers in the whole timeline or in the time range
The first DuAEKeyframe._time will be adjusted relatively to the start of the time range (if provided) instead of the startTime of the composition.
Parameters:
Name Type Attributes Default Description
layers Array.<Layer> | LayerCollection The layers.
selected Boolean <optional>
false true to get only selected keyframes.
timeRange Array.<float> <optional>
The time range, an array of two time values, in seconds.

View Source Duik_api_fordoc.jsxinc, line 31122

The animations.
Array.<DuAELayerAnimation>

# static getChildren(layer) → {Array.<Layer>}

Gets the children of a layer
Parameters:
Name Type Description
layer Layer The layer.

View Source Duik_api_fordoc.jsxinc, line 31308

All the children of the layer
Array.<Layer>

# static getCreateLayerEffect(layer, targetLayer, effectNameopt) → {DuAEProperty|null}

Gets or create a layer control effect targetting the given target layer.
Parameters:
Name Type Attributes Description
layer Layer The layer to get the effect from
targetLayer Layer The targetted layer, which must be in the same comp than the layer.
effectName string <optional>
The name to use when creating the effect.

View Source Duik_api_fordoc.jsxinc, line 32485

The effect or null if the two layers are not in the same comp.
DuAEProperty | null

# static getDistance(layer1opt, layer2opt) → {float}

Measures the distance between two layers
Parameters:
Name Type Attributes Description
layer1 Layer <optional>
The first layer. If omitted, will use the selected layers in the current comp
layer2 Layer <optional>
The second layer

View Source Duik_api_fordoc.jsxinc, line 31374

The distance (in pixels). -1 if less than two layers are found
float

# static getMaxDistance(layers) → {float}

Gets the maximum distance between a bunch of layers
Parameters:
Name Type Description
layers Array.<Layer> | DuList.<Layer> | LayerCollection The layers

View Source Duik_api_fordoc.jsxinc, line 31395

The distance (in pixels)
float

# static getPuppetPins(layer) → {Array.<DuAEProperty>}

Gets all the (selected) puppet pins found on the layer.
Will return all puppet pins if there is no puppet selection.
Parameters:
Name Type Description
layer Layer The layer

View Source Duik_api_fordoc.jsxinc, line 31896

The properties
Array.<DuAEProperty>

# static getRelation(layer1, layer2) → {int|null}

Checks if a layer is a descendant of another layer
Parameters:
Name Type Description
layer1 Layer The first layer
layer2 Layer The second layer

View Source Duik_api_fordoc.jsxinc, line 31344

the degree of relation. 0 if layer1 is not a relative of layer2,
negative if layer2 is a descendant of layer1, positive if layer2 is an ancestor.
null if the two layers are not in the same composition or if they are the same layer.
int | null

# static getSelectedProps(layer, filteropt, strictopt, caseSensitiveopt) → {Array.<DuAEProperty>}

Gets the After Effects selected properties in the layer
Parameters:
Name Type Attributes Default Description
layer Layer The layer
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, whether 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?

View Source Duik_api_fordoc.jsxinc, line 31027

The selected properties, an empty Array if nothing active or selected
Array.<DuAEProperty>

# static getTransformMatrix(layer, timeopt) → {Matrix}

Gets the transformation matrix of the layer from the compostion.
Use Matrix.applyToPoint(point) to transform any coordinate with the matrix returned by this method.
Parameters:
Name Type Attributes Description
layer Layer the layer
time float <optional>
the time at which to get the coordinates. Current time by default.

View Source Duik_api_fordoc.jsxinc, line 32068

The coordinates.
Matrix

# static getWorldPos(layer, pointopt, timeopt) → {Array.<Number>}

Gets the world coordinates of the point of a layer
Parameters:
Name Type Attributes Default Description
layer Layer The layer
point Array.<Number> <optional>
layer.transform.anchorPoint.value the point
time Number <optional>
the time at which to get the coordinates. Current time by default.

View Source Duik_api_fordoc.jsxinc, line 31415

The world coordinates of the layer
Array.<Number>

# static hasChild(layer) → {Boolean}

Checks if a layer has at least one child.
Parameters:
Name Type Description
layer Layer The layer to test

View Source Duik_api_fordoc.jsxinc, line 31325

true if the layer has at least one child.
Boolean

# static hasExpressions(layer) → {Boolean}

Checks if the layer has some expressions
Parameters:
Name Type Description
layer Layer The layer

View Source Duik_api_fordoc.jsxinc, line 32802

Boolean

# static hasKeys(layer) → {Boolean}

Checks if the layer has some keyframes
Parameters:
Name Type Description
layer Layer The layer

View Source Duik_api_fordoc.jsxinc, line 32792

Boolean

# static hasMask(layer) → {Boolean}

Checks if the layer has some masks
Parameters:
Name Type Description
layer Layer The layer

View Source Duik_api_fordoc.jsxinc, line 32812

Boolean

# static haveSelectedKeys(layers) → {boolean}

Checks if the layers have some selected keyframes
Parameters:
Name Type Description
layers Array.<Layer> | LayerCollection The layers

View Source Duik_api_fordoc.jsxinc, line 31544

true if the layers have at least one selected keyframe
boolean

# static height(layer) → {Number}

Gets the actual height of a layer (including it's scale)
Parameters:
Name Type Description
layer AVLayer The layer

View Source Duik_api_fordoc.jsxinc, line 32720

The height, in pixels.
Number

# static insideComp(layer, useBoundsopt) → {Boolean}

Checks if the layer is inside the bounds of the composition
Parameters:
Name Type Attributes Default Description
layer Layer the layer to check
useBounds Boolean <optional>
false (not implemented yet) Checks the layer bounds if true, just the anchor point if false.

View Source Duik_api_fordoc.jsxinc, line 32251

true if the layer is inside the composition
Boolean

# static isComp(layer) → {Boolean}

Checks if the given layer is a precomposition.
Parameters:
Name Type Description
layer Layer The layer to test

View Source Duik_api_fordoc.jsxinc, line 32235

true if it is a composition
Boolean

# static isNull(layer) → {bool}

Checks if this is a null layer, either a true AE Null layer, or a "Shape as Null" as created by DuAEF with DuAEComp.addNull.
Parameters:
Name Type Description
layer Layer The layer to test

View Source Duik_api_fordoc.jsxinc, line 32822

bool

# static isRenderable() → {Bool}

Checks if a layer is renderable. A non-renderable layer can be:
  • A Null layer
  • A Guide layer
  • An empty shape layer
  • An empty text layer
  • A layer with the opacity at 0% for the whole composition

View Source Duik_api_fordoc.jsxinc, line 32613

Bool

# static isSolid(layer) → {Boolean}

Checks if the given layer is a solid.
Parameters:
Name Type Description
layer Layer The layer to test

View Source Duik_api_fordoc.jsxinc, line 32218

true if it is a solid
Boolean

# static isThreeD(layer) → {bool}

Checks if a layer is 3D (ie is a threeDLayer or a camera or a light)
Parameters:
Name Type Description
layer Layer The layer

View Source Duik_api_fordoc.jsxinc, line 32185

true if the layer is a 3D layer
bool

# static isType(layer, layerType) → {Boolean}

Checks if the layer is one of the types created by duaef.
Parameters:
Name Type Description
layer Layer The layer to check
layerType Duik.Layer.Type The type of layer

View Source Duik_api_fordoc.jsxinc, line 30889

Boolean

# static isTypePrefix(prefix) → {bool}

Checks if a string is one of the prefixes used to identify layer types in their names
Parameters:
Name Type Description
prefix string The string to check

View Source Duik_api_fordoc.jsxinc, line 30876

True if the string is one of the predefined prefixes.
bool

# static lastEffect(layer, nameopt, skipopt) → {PropertyGroup|null}

Gets the last corresponding effect (instead of the first with the native layer.effect() method)
Parameters:
Name Type Attributes Default Description
layer Layer The layer
name string <optional>
The name or matchname to look for. If omitted, will return the last effect.
skip int <optional>
0 Number of effects to skip

View Source Duik_api_fordoc.jsxinc, line 32282

The effect or null if not found.
PropertyGroup | null

# static lockScale(layer)

Locks the scale with an expression so its value cannot be changed
Parameters:
Name Type Description
layer Layer The layer

View Source Duik_api_fordoc.jsxinc, line 31807

# static moveInsideComp(layer, useBoundsopt)

Moves a layer in the center of the comp if it is outside
Parameters:
Name Type Attributes Default Description
layer Layer the layer to check
useBounds Boolean <optional>
false (not implemented yet) Checks the layer bounds if true, just the anchor point if false.

View Source Duik_api_fordoc.jsxinc, line 32266

# static moveLayerToProperty(layer, prop)

Moves a layer to the coordinates of a spatial property
Parameters:
Name Type Description
layer Layer The layer
prop Property | DuAEProperty The property

View Source Duik_api_fordoc.jsxinc, line 32115

# static newUniqueEffectName(newName, layer, incrementopt) → {string}

Generates a new unique name for an effect
Parameters:
Name Type Attributes Default Description
newName string The wanted new name
layer Layer The layer
increment boolean <optional>
true true to automatically increment the new name if it already ends with a digit

View Source Duik_api_fordoc.jsxinc, line 30984

The unique name, with a new number at the end if needed.
string

# static newUniqueMarkerName(newName, layer, incrementopt) → {string}

Generates a new unique name for a marker for this layer
Parameters:
Name Type Attributes Default Description
newName string The wanted new name
layer Layer The layer
increment boolean <optional>
true true to automatically increment the new name if it already ends with a digit

View Source Duik_api_fordoc.jsxinc, line 31009

The unique name, with a new number at the end if needed.
string

# static parent(layers, parentopt, unparentedOnlyopt, insertopt)

Parents all (unparented) layers
Parameters:
Name Type Attributes Default Description
layers Layer | LayerCollection | Array.<Layer> | DuList.<Layer> The layers to parent
parent Layer <optional>
The parent. If not defined, will use the last layer of the list
unparentedOnly boolean <optional>
true True to parent only layers which do not have a parent yet
insert boolean <optional>
false When true, the parent will be parented to the previous parent of the given layer (or first layer if the layers param is a list)

View Source Duik_api_fordoc.jsxinc, line 31868

# static parentChain(layers)

Parents all the layers together beginning by the end of the array
Parameters:
Name Type Description
layers Array.<Layer> | DuList.<Layer> The layers to parent

View Source Duik_api_fordoc.jsxinc, line 31653

# static relativeLocation(point, referenceLayer) → {DuMath.Location}

Returns the location of the layer relative to the reference.
Parameters:
Name Type Description
point Layer The layer to check
referenceLayer Layer The reference

View Source Duik_api_fordoc.jsxinc, line 32858

The location

# static rename(layer, newName) → {string}

Renames a layer, appending a number if needed to keep unique names, and fixing expressions
Parameters:
Name Type Description
layer Layer
newName string

View Source Duik_api_fordoc.jsxinc, line 30946

The new name which may be different than newName in case the layer has been numbered.
string

# static repositionAnchorPoint(layer, value)

Changes the coordinates of the anchor point without moving the layer
Parameters:
Name Type Description
layer Layer The layer
value Array.<Number> The new coordinates

View Source Duik_api_fordoc.jsxinc, line 32301

# static reverseAnims(anims)

Reverses the times of the keyframes to reverse the animation
Parameters:
Name Type Description
anims Array.<DuAELayerAnimation> | DuAELayerAnimation The animation

View Source Duik_api_fordoc.jsxinc, line 31256

# static sequence(layersopt, expropt)

Creates a sequence with the layers, but using opacities. This enables more possibilities to rig them, like with the Duik Connector
Parameters:
Name Type Attributes Description
layers Array.<Layer> | LayerCollection <optional>
The layers. The selected layers by default.
expr string <optional>
An expression to add to the opacity of the layers

View Source Duik_api_fordoc.jsxinc, line 31769

# static setAllAnims(layers, anims, timeopt, ignoreNameopt, setExpressionopt, onlyKeyframesopt, replaceopt, whiteListopt, offsetopt, reverseopt)

Sets the animations on the layers.
If you need to set only on the same layers (same index, same name), use DuAELayer.setAnims.
Parameters:
Name Type Attributes Default Description
layers Array.<Layer> | LayerCollection The layers.
If there are more layers than animations, the layers array will be truncated.
anims Array.<DuAELayerAnimation> The layer animations.
If there are more animations than layers, the animations array will be truncated.
time float <optional>
comp.time The time where to begin the animation
ignoreName Boolean <optional>
false true to set the anim even if name of the property do not match the name animation.
This way, only the type of property (i.e. matchName) is checked.
setExpression Boolean <optional>
false Set the expression on the property
onlyKeyframes Boolean <optional>
true If false, the value of properties without keyframes will be set too.
replace Boolean <optional>
false true to remove any existing keyframe on the properties before adding new keyframes
whiteList Array.<string> <optional>
A list of matchNames used as a white list for properties to set anims.
Can be the matchName of a propertyGroup to set all the subproperties.
offset Boolean <optional>
false true to offset the current value, instead of replacing it
reverse Boolean <optional>
false true to reverse the keyframes (in time)
Note: the remaining animations which are returned will already be reversed, do not set this to true again if you plan to set them later.

View Source Duik_api_fordoc.jsxinc, line 31194

# static setAnim(layer, anims, timeopt, ignoreNameopt, setExpressionopt, onlyKeyframesopt, replaceopt, propertyWhiteListopt, offsetopt, reverseopt, dontMoveAncestorsopt) → {Boolean}

Sets the property animation on the property
Parameters:
Name Type Attributes Default Description
layer Layer The layer.
anims DuAELayerAnimation The animation
time float <optional>
comp.time The time where to begin the animation
ignoreName Boolean <optional>
false true to set the anim even if name of the property do not match the name of the animation.
This way, only the type of property (i.e. matchName) is checked.
setExpression Boolean <optional>
false Set the expression on the property
onlyKeyframes Boolean <optional>
true If false, the value of properties without keyframes will be set too.
replace Boolean <optional>
false true to remove any existing keyframe on the properties before adding new keyframes
propertyWhiteList Array.<string> <optional>
A list of matchNames used as a white list for properties to set anims.
Can be the matchName of a propertyGroup to set all the subproperties.
offset Boolean <optional>
false true to offset the current value, instead of replacing it
reverse Boolean <optional>
false true to reverse the keyframes (in time)
dontMoveAncestors Boolean <optional>
false When set to true, the transform (position, rotation) values for ancestor layers (the ones without parent) will be offset to 0 before applying the animation.

View Source Duik_api_fordoc.jsxinc, line 31147

true if the anim was actually set.
Boolean

# static setAnims(layers, anims, timeopt, ignoreNameopt, setExpressionopt, onlyKeyframesopt, replaceopt, whiteListopt, offsetopt, reverseopt, dontMoveAncestorsopt) → {Array.<DuAELayerAnimation>}

Sets the animations on the corresponding layers.
The animation will be set only on layers with the same name and index.
To set all animations on all layers, not checking their names or indices, use DuAELayer.setAllAnims.
Parameters:
Name Type Attributes Default Description
layers Array.<Layer> | LayerCollection The layers.
anims Array.<DuAELayerAnimation> The layer animations
time Number <optional>
comp.time The time where to begin the animation
ignoreName Boolean <optional>
false true to set the anim even if name of the property do not match the name animation.
This way, only the type of property (i.e. matchName) is checked.
setExpression Boolean <optional>
false Set the expression on the property
onlyKeyframes Boolean <optional>
true If false, the value of properties without keyframes will be set too.
replace Boolean <optional>
false true to remove any existing keyframe on the properties before adding new keyframes
whiteList Array.<string> <optional>
A list of matchNames used as a white list for properties to set anims.
Can be the matchName of a propertyGroup to set all the subproperties.
offset Boolean <optional>
false true to offset the current value, instead of replacing it
reverse Boolean <optional>
false true to reverse the keyframes (in time)
Note: the remaining animations which are returned will already be reversed, do not set this to true again if you plan to set them later.
dontMoveAncestors Boolean <optional>
false When set to true, the transform (position, rotation) values for ancestor layers (the ones without parent) will be offset to 0 before applying the animation.

View Source Duik_api_fordoc.jsxinc, line 31226

The animations which were not set (no corresponding layers)
Array.<DuAELayerAnimation>

# static setPosition(layer, position, worldopt)

Sets the new coordinates of the layer.
Parameters:
Name Type Attributes Default Description
layer Layer The layer to move
position Array.<float> The new coordinates
world boolean <optional>
false Set to true to use world coordinates.

View Source Duik_api_fordoc.jsxinc, line 32771

# static setType(type, layersopt)

Sets the type of the layer
Parameters:
Name Type Attributes Default Description
type Duik.Layer.Type The type
layers Array.<Layer> | LayerCollection | DuList.<Layer> | Layer <optional>
DuAEComp.getSelectedLayers() The layer. If omitted, will use all selected layers in the comp

View Source Duik_api_fordoc.jsxinc, line 30912

# static sortByIndex(layers) → {Array.<Layer>}

Sort the layers by their indices. Returns a new Array, the original array or collection is not changed.
Parameters:
Name Type Description
layers Array.<Layer> | LayerCollection | DuList.<Layer> The layers to sort

View Source Duik_api_fordoc.jsxinc, line 31639

The sorted array
Array.<Layer>

# static sortByParent(layers) → {Array.<Layer>}

Sort the layers by their parenting (root at first index 0) Layers with a parent outside of the list are at the beginning, followed by layers without parent Note that the order of these layers is reversed
Parameters:
Name Type Description
layers Array.<Layer> | Collection | DuList.<Layer> The layers to sort

View Source Duik_api_fordoc.jsxinc, line 31584

The sorted array
Array.<Layer>

# static sourceRect(layer, timeopt, includeExtentsopt, includeMasksopt) → {Array.<float>}

Returns the bounds of the layer in local coordinates, like the sourceRectAtTime() function does in expressions, but can also include masks.
Parameters:
Name Type Attributes Default Description
layer Layer The layer
time float <optional>
The time at which to get the bounds, the current time by default
includeExtents Boolean <optional>
true Includes the extents (strokes, accents...)
includeMasks Boolean <optional>
true Includes the masks

View Source Duik_api_fordoc.jsxinc, line 32428

The bounds [top, left, width, height]
Array.<float>

# static stack(layers)

Stacks the layers in the timeline according to their order in the given array/DuList
Parameters:
Name Type Description
layers LayerCollection | Array.<Layer> | DuList.<Layer> The layers to stack

View Source Duik_api_fordoc.jsxinc, line 32738

# static toggleEditMode(layer)

(Un)parent the children of the layer.< br/> When children are unparented, an effect is added and the name of the layer is changed to show the "edit mode" is enabled.
When toggled again, the effect is removed, and the name is restored.
Parameters:
Name Type Description
layer Layer The layer to toggle.

View Source Duik_api_fordoc.jsxinc, line 31687

# static translate(layer, offset, worldopt)

Sets the new coordinates of the layer to translate it by offset.
Parameters:
Name Type Attributes Default Description
layer Layer The layer to move
offset Array.<float> The value of the translation. A two or three dimensionnal array.
world boolean <optional>
false Set to true to offset in world coordinates.

View Source Duik_api_fordoc.jsxinc, line 32752

# static type(layeropt) → {Duik.Layer.Type}

Gets the type of the layer
Parameters:
Name Type Attributes Description
layer Layer <optional>
The layer. If omitted, will check the first selected bone of the current comp

View Source Duik_api_fordoc.jsxinc, line 30898

The type

# static unparent(layers)

Un-parents all the layers
Parameters:
Name Type Description
layers Array.<Layer> The layers

View Source Duik_api_fordoc.jsxinc, line 31675

# static width(layer) → {Number}

Gets the actual width of a layer (including it's scale)
Parameters:
Name Type Description
layer AVLayer The layer

View Source Duik_api_fordoc.jsxinc, line 32701

The width, in pixels.
Number