Namespace

Constraint

Duik.Constraint

Constraint tools.

View Source api3.jsxinc, line 7941

Members

Number

# static IKType

The types of IK for three-layer chains.
Properties:
Name Type Description
ONE_TWO Number
TWO_ONE Number
FK Number
BEZIER_IK Number
BEZIER_FK Number

View Source api3.jsxinc, line 7947

Methods

# static alignLayers(positionopt, rotationopt, scaleopt, opacityopt)

Align selected Layers to the last selected one
Parameters:
Name Type Attributes Default Description
position Boolean <optional>
true whether to align the position.
rotation Boolean <optional>
true whether to align the rotation.
scale Boolean <optional>
true whether to align the scale.
opacity Boolean <optional>
true whether to align the opacity.

View Source api3.jsxinc, line 8475

# static applyLocatorValues(layersopt, disableopt)

Sets the current values of the locators. This fixes some bugs when unparenting layers parented to the locators.
Parameters:
Name Type Attributes Default Description
layers Layer | LayerCollection | Array.<Layer> | DuList.<Layer> <optional>
DuAEComp.getSelectedLayers() The layer(s). If omitted, will use all selected layers in the comp
disable boolean <optional>
true whether to disable the expressions after having applied the values

View Source api3.jsxinc, line 11614

# static autoParent(orphansOnlyopt, layersopt, selectionOrderopt)

Auto-Parent. Parent selected layers to the last selected one.
Parameters:
Name Type Attributes Default Description
orphansOnly Boolean <optional>
false When true, parent only the orphans to the last selected layers
layers Array.<Layer> | DuList.<Layer> <optional>
The layers
selectionOrder Boolean <optional>
false When true, parent in the order of the selection, from ancestor to child

View Source api3.jsxinc, line 11320

# static bezierFK(layers, goalopt, controlleropt, showGuidesopt, rootControlleropt) → {Array.<Layer>}

Creates a bezier fk on the layers
Parameters:
Name Type Attributes Default Description
layers Array.<Layer> | DuList.<Layer> The layers, ordered from root to end
goal Layer | null <optional>
The goal layer, at the end of the IK
controller Layer | null <optional>
The layer to use as controller, can be automatically created.
Must be provided if goal is undefined.
showGuides Boolean <optional>
true Set to false to hide guides on the controllers (and improve performance)
rootController Layer | null <optional>
The layer to use as root controller, can be automatically created.

View Source api3.jsxinc, line 11043

The controllers [curve,end,root,rootpos, rootrot]
Array.<Layer>

# static bezierIK(layers, goalopt, controlleropt, showGuidesopt) → {Array.<Layer>}

Creates a bezier ik on the layers
Parameters:
Name Type Attributes Default Description
layers Array.<Layer> | DuList The layers, ordered from root to end
goal Layer | null <optional>
The goal layer, at the end of the IK
controller Layer | null <optional>
The layer to use as controller, can be automatically created.
Must be provided if goal is undefined.
showGuides Boolean <optional>
true Set to false to hide guides on the controllers (and improve performance)

View Source api3.jsxinc, line 10647

The controllers [curve,end,root]
Array.<Layer>

# static connector(props, masterProp, minopt, maxopt, axisopt, typeopt, toKeyMorphopt) → {PropertyGroup}

Connects the properties to a master property.
Parameters:
Name Type Attributes Default Description
props Array.<DuAEProperty> | DuList.<DuAEProperty> The child properties
masterProp Property | DuAEProperty The parent property
min float <optional>
0 The minimum value
max float <optional>
100 The maximum value
axis DuAE.Axis <optional>
DuAE.Axis.X The axis or channel to connect
type DuAE.Type <optional>
DuAE.Type.VALUE The type
toKeyMorph boolean <optional>
By default, the connector will detect Key Morphs to adjust the connection on the weight of the selected keys.
When set to true, it will just connect the weight of the selected key morphs (or all of them if not selected).
When false, it does a standard connection even if some key morphs are selected.

View Source api3.jsxinc, line 12173

The controlling effect created
PropertyGroup

# static createList(prop, addKeyframeopt) → {DuAEProperty}

Adds a list on a property
Parameters:
Name Type Attributes Default Description
prop Property | DuAEProperty The Property
addKeyframe Boolean <optional>
false Set to true to automatically add a keyframe to the second slot (which makes it quicker to find in the AE Timeline using the 'U' shortcut)

View Source api3.jsxinc, line 7989

The list effect
DuAEProperty

# 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 api3.jsxinc, line 11510

The locator
ShapeLayer

# static disableLocator(layersopt, disableopt)

Disables the locator. Disable the transform expressions
Parameters:
Name Type Attributes Default Description
layers Layer | LayerCollection | Array.<Layer> | DuList.<Layer> <optional>
DuAEComp.getSelectedLayers() The layer(s). If omitted, will use all selected layers in the comp
disable boolean <optional>
true

View Source api3.jsxinc, line 11648

# static exposeTransform(compopt, layersopt) → {Array.<ShapeLayer>}

Expose Transform
Parameters:
Name Type Attributes Description
comp CompItem <optional>
The composition where to create the expose transform controller. The active composition by default.
layers Array.<Layer> | DuList <optional>
The layer with the transformation to expose. The selected layers by default. Can be an empty list too, in this case the Expose Transform controller is not set to measure any layer.

View Source api3.jsxinc, line 8506

The list of the new Expose Transform controllers. One per given layer.
Array.<ShapeLayer>

# static extractLocator(locator, preCompLayer, useEssentialPropertiesopt) → {ShapeLayer}

Extracts one locator from a precomposition
Parameters:
Name Type Attributes Default Description
locator ShapeLayer The locator to extract
preCompLayer AVLayer The precomposition layer
useEssentialProperties Boolean <optional>
true true to extract using master properties instead of expressions (ignored in Ae < 15.1, false by default if 15.1 <= Ae < 17 and true by default in Ae >= 17)

View Source api3.jsxinc, line 11550

The extracted locator
ShapeLayer

# static extractLocators(useEssentialPropertiesopt, precompLayersopt)

Extract Locators
Parameters:
Name Type Attributes Description
useEssentialProperties Boolean <optional>
whether to use essential properties instead of expressions to extract the controllers. True by default if Ae >= 17.0
precompLayers Array.<Layer> | DuList.<Layer> <optional>
The layers

View Source api3.jsxinc, line 11520

# static fk(layersopt, controlleropt) → {Layer}

Creates a FK with auto-overlapping and its controller on the layers.
Parameters:
Name Type Attributes Description
layers Array.<Layer> | DuList.<Layer> <optional>
The layers, already parented or ordered from root (at index 0) to end
controller Layer <optional>
An already existing controller.

View Source api3.jsxinc, line 11118

The controller of the FK.
Layer

# static ik(typeopt, forceBezieropt, layersopt, controlleropt, bezierFKopt) → {Array.<Layer>}

Creates an IK on the layers
Parameters:
Name Type Attributes Default Description
type Duik.IKType <optional>
Duik.Constraint.IKType.ONE_TWO The type of IK to use with three layers.
forceBezier boolean <optional>
false force the use of a bezier IK even with two or three layers
layers Array.<Layer> | LayerCollection | DuList.<Layer> | Layer <optional>
DuAEComp.getSelectedLayers() The layer. If omitted, will use all selected layers in the comp
controller Layer <optional>
An already existing controller.
bezierFK boolean <optional>
false If forceBezier, adds a layer for FK Control

View Source api3.jsxinc, line 9229

The controller(s) of the IK.
Array.<Layer>

# static linkLayersToDropdown(dropdown, layersopt)

Connects a dropdown menu effect to a list of layers, using their opacities.
Note: On After Effects < 17.0.1, the list is not updated to reflect the list of layers.
Parameters:
Name Type Attributes Description
dropdown DuAEProperty | Property The dropdown menu property.
layers Array.<Layer> | DuList.<Layer> <optional>
The layers to control. The selected layers by default.

View Source api3.jsxinc, line 12566

# static list(addKeyframeopt)

List
Parameters:
Name Type Attributes Default Description
addKeyframe Boolean <optional>
false Set to true to automatically add a keyframe to the second slot (which makes it quicker to find in the AE Timeline using the 'U' shortcut)

View Source api3.jsxinc, line 7967

# static locator(layersopt)

Add Locator
Parameters:
Name Type Attributes Description
layers Array.<Layer> | DuList.<Layer> <optional>
The layers

View Source api3.jsxinc, line 11493

# static lock(propsopt)

Lock propery values
Parameters:
Name Type Attributes Description
props Property | DuAEProperty | Array.<Property> | Array.<DuAeProperty> | DuList.<Property> | DuList.<DuAEProperty> <optional>
The properties. If omitted, locks the selected properties

View Source api3.jsxinc, line 8287

# static morphKeys()

Morph Keys

View Source api3.jsxinc, line 8999

# static moveAnchorPoint(location, mopt, includeMasksopt, layersopt)

Repositions the anchor points of the layers
Parameters:
Name Type Attributes Default Description
location DuMath.Location The new location of the anchor points relative to the layer bounds.
m Number <optional>
0.0 A margin, in pixels.
includeMasks Boolean <optional>
false Use masks to compute the bounds.
layers Array.<Layer> | LayerCollection | DuList | Layer <optional>
DuAEComp.getSelectedLayers() The layer. If omitted, will use all selected layers in the comp

View Source api3.jsxinc, line 8362

# static oneLayerIK(layer, goalopt, controlleropt, showGuidesopt) → {Layer}

Creates a one-layer-ik on the layer
Parameters:
Name Type Attributes Default Description
layer Layer The layer
goal Layer | null <optional>
The goal layer, at the end of the IK
controller Layer | Controller | null <optional>
The layer to use as a controller, can be automatically created.
Must be provided if goal is undefined
showGuides Boolean <optional>
true Set to false to hide guides on the controllers (and improve performance)

View Source api3.jsxinc, line 9295

The controller created
Layer

# static oneTwoLayerIK(layer1, layer2, layer3, goalopt, controlleropt, showGuidesopt) → {Layer}

Creates a 1+2-layer-ik on the layer
Parameters:
Name Type Attributes Default Description
layer1 Layer The root layer
layer2 Layer The middle layer
layer3 Layer The end layer
goal Layer | null <optional>
The goal layer, at the end of the IK
controller Layer | null <optional>
The layer to use as a controller, can be automatically created.
Must be provided if goal is undefined
showGuides Boolean <optional>
true Set to false to hide guides on the controllers (and improve performance)

View Source api3.jsxinc, line 10552

The controller created
Layer

# static orientation(layersopt) → {Array.<Property>}

Adds an orientation constraint to the layers
Parameters:
Name Type Attributes Description
layers Layer | Array.<Layer> | DuList.<Layer> <optional>
The layers

View Source api3.jsxinc, line 11847

The effects added on the layers to control the constraint.
Array.<Property>

# static parent(layersopt)

Parent Constraint
Parameters:
Name Type Attributes Description
layers Array.<Layer> | DuList.<Layer> <optional>
The layers

View Source api3.jsxinc, line 11340

# static parentAcrossComp(parent, useEssentialPropertiesopt, childrenopt)

Parent the layers across compositions to the chosen layer
Parameters:
Name Type Attributes Default Description
parent Layer The parent layer
useEssentialProperties Boolean <optional>
true true to extract using master properties instead of expressions (ignored in Ae < 15.1, false by default if 15.1 <= Ae < 17 and true by default in Ae >= 17)
children Array.<Layer> | DuList.<Layer> <optional>
The child layers

View Source api3.jsxinc, line 11677

# static path(pathopt, layersopt, moveToPathopt) → {Boolean}

Description
Parameters:
Name Type Attributes Default Description
path PropertyBase | DuAEProperty <optional>
The path, taken from the layer selection if omitted
layers Array.<Layer> | DuList.<Layer> <optional>
The layers
moveToPath boolean <optional>
false Set to true to move the layer to the first point on the path

View Source api3.jsxinc, line 11895

true if a constraint could be created
Boolean

# static pin(tangentsopt, propsopt) → {Array.<ShapeLayer>}

Add pins on the properties
Parameters:
Name Type Attributes Default Description
tangents Boolean <optional>
true Set to false to ignore Bézier path tangents
props Array.<PropertyBase> <optional>
The properties to pin

View Source api3.jsxinc, line 11993

The pins
Array.<ShapeLayer>

# static position(layersopt) → {Array.<Property>}

Adds a position constraint to the layers
Parameters:
Name Type Attributes Description
layers Layer | Array.<Layer> | DuList.<Layer> <optional>
The layers

View Source api3.jsxinc, line 11794

The effects added on the layers to control the constraint.
Array.<Property>

# static quickConnector(propsopt)

Connects the properties together to a % slider
Parameters:
Name Type Attributes Description
props Array.<Property> | Array.<DuAEProperty> <optional>
The properties to connect. The selected properties by default.

View Source api3.jsxinc, line 12499

# static removeCompInExpressions(selectionModeopt)

Replace all comp("name") occurences by thisComp.
Parameters:
Name Type Attributes Default Description
selectionMode Duik.SelectionMode <optional>
DuAE.SelectionMode.ACTIVE_COMPOSITION The items where to modify the expressions.

View Source api3.jsxinc, line 12123

# static removeLayerInExpressions(selectionModeopt)

Replace all layer("name") occurences by thisLayer.
Parameters:
Name Type Attributes Default Description
selectionMode Duik.SelectionMode <optional>
DuAE.SelectionMode.ACTIVE_COMPOSITION The items where to modify the expressions.

View Source api3.jsxinc, line 12151

# static removeThisCompInExpressions(selectionModeopt)

Replace all thisComp occurences by comp("name").
Parameters:
Name Type Attributes Default Description
selectionMode Duik.SelectionMode <optional>
DuAE.SelectionMode.ACTIVE_COMPOSITION The items where to modify the expressions.

View Source api3.jsxinc, line 12109

# static removeThisLayerInExpressions(selectionModeopt)

Replace all thisLayer occurences by layer("name").
Parameters:
Name Type Attributes Default Description
selectionMode Duik.SelectionMode <optional>
DuAE.SelectionMode.ACTIVE_COMPOSITION The items where to modify the expressions.

View Source api3.jsxinc, line 12137

# static resetPRS(layersopt, opacityopt)

Resets the transformation of the selected layers to 0.
Parameters:
Name Type Attributes Default Description
layers Array.<Layer> | LayerCollection | DuList.<Layer> | Layer <optional>
DuAEComp.getSelectedLayers() The layer. If omitted, will use all selected layers in the comp
opacity Boolean <optional>
false When true, also resets the opacity to 100%

View Source api3.jsxinc, line 8422

# static separateDimensions()

Separate Dimensions

View Source api3.jsxinc, line 8112

# static separatePropDimensions(prop) → {Array.<DuAEProperty>}

Separates the dimensions of the properties into an effect.
Works with 2D, 3D, and colors
Parameters:
Name Type Description
prop Property | DuAEProperty The property

View Source api3.jsxinc, line 8131

The seperated properties (or the original one if it could not be separated)
Array.<DuAEProperty>

# static setupAudioController(audioLayeropt) → {DuAEProperty}

Prepares a visual audio controller to connect to properties
Parameters:
Name Type Attributes Description
audioLayer AVLayer <optional>
The layer with the audio to setup. The selected layer by default.

View Source api3.jsxinc, line 12607

The value to use with the connector
DuAEProperty

# static simpleFK(layersopt, controlleropt) → {Layer}

A very simple FK control
Parameters:
Name Type Attributes Description
layers Array.<Layer> | DuList.<Layer> <optional>
The layers, already parented or ordered from root (at index 0) to end
controller Layer <optional>
An already existing controller.

View Source api3.jsxinc, line 12055

The controller of the FK.
Layer

# static twoLayerIK(layer1, layer2, goalopt, controlleropt, showGuidesopt) → {Layer}

Creates a two-layer-ik on the layer
Parameters:
Name Type Attributes Default Description
layer1 Layer The root layer
layer2 Layer The end layer
goal Layer | null <optional>
The goal layer, at the end of the IK
controller Layer | null <optional>
The layer to use as a controller, can be automatically created.
Must be provided if goal is undefined
showGuides Boolean <optional>
true Set to false to hide guides on the controllers (and improve performance)

View Source api3.jsxinc, line 9676

The controller created
Layer

# static twoOneLayerIK(layer1, layer2, layer3, goalopt, controlleropt, showGuidesopt) → {Layer}

Creates a 1+2-layer-ik on the layer
Parameters:
Name Type Attributes Default Description
layer1 Layer The root layer
layer2 Layer The middle layer
layer3 Layer The end layer
goal Layer | null <optional>
The goal layer, at the end of the IK
controller Layer | null <optional>
The layer to use as a controller, can be automatically created.
Must be provided if goal is undefined
showGuides Boolean <optional>
true Set to false to hide guides on the controllers (and improve performance)

View Source api3.jsxinc, line 10572

The controller created
Layer

# static zero(layersopt) → {Array.<ShapeLayer>}

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

View Source api3.jsxinc, line 8305

The zeroes
Array.<ShapeLayer>