DuAEF.Duik.Rigging

Duik Rigging Tools
Author:
  • Nicolas Dufresne, Kevin Masson and contributors
License:
  • GPL-3.0
    DuAEF is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    DuAEF is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with DuAEF. If not, see http://www.gnu.org/licenses/.

Members

static, readonly chainTypes :int

Chain Rig types
Properties:
Name Type Description
IK int
FK int
BEZIER int

Methods

static addLocator(layerOrCompopt) → {AVLayer}

Adds a locator to a layer
Parameters:
Name Type Attributes Default Description
layerOrComp Layer | CompItem <optional>
DuAEF.DuAE.Project.getActiveComp() The layer or the containing comp, to add a standalone locator.
Returns:
AVLayer - The locator, a null object

static addZero(layer) → {AVLayer}

Adds a zero to a layer
Parameters:
Name Type Description
layer Layer The layer
Returns:
AVLayer - The zero, a null

static applyLocatorsValues(compopt, 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
comp CompItem <optional>
The composition containing the locators
disable boolean <optional>
true Wether to disable the expressions after having applied the values

static applyLocatorValues(locator, disableopt)

Sets the current values of the locator. This fixes some bugs when unparenting layers parented to the locators.
Parameters:
Name Type Attributes Default Description
locator AVLayer The locator layer
disable boolean <optional>
true Wether to disable the expressions after having applied the values

static bezierIK(layers, goalopt, controllersopt) → {Array.<Controller>}

Creates a bezier ik on the layers
Parameters:
Name Type Attributes Description
layers Array.<Layer> | Structure The layers, ordered from root to end
goal Layer | null <optional>
The goal layer, at the end of the IK
controllers Layer | Controller | null <optional>
The layer to use as controller, can be automatically created.
Must be provided if goal is undefined.
Returns:
Array.<Controller> - The controllers [curve,end,root]

static connector(childProp, parentProp, parentEffectopt, minValueopt, maxValueopt, axisopt, axisopt) → {PropertyGroup}

Applies connector to the property
Parameters:
Name Type Attributes Default Description
childProp Property | PropertyInfo The child property
parentProp Property | PropertyInfo The parent property
parentEffect PropertyGroup | PropertyInfo | null <optional>
The effect of an already existing connector
minValue float <optional>
0 The minimum value
maxValue float <optional>
100 The maximum value
axis DuAEF.DuAE.Axis <optional>
DuAEF.DuAE.Axis.X The axis or channel to connect
axis DuAEF.DuAE.Types <optional>
DuAEF.DuAE.Types.VALUE The type
Returns:
PropertyGroup - The controlling effect created

static connectorCheckParent(prop) → {int}

Checks if the property can be used as parent with the connector
Parameters:
Name Type Description
prop Property | PropertyInfo The property
Returns:
int - 0 if the prop can not be used as parent, or the number of the dimensions of the property (4 = color)

static disableLocator(locator, disableopt)

Disables the locator. Disable the transform expressions
Parameters:
Name Type Attributes Default Description
locator AVLayer The locator layer
disable boolean <optional>
true Wether to disable the expressions after having applied the values

static disableLocators(compopt, disableopt)

Disables the locators. Disable the transform expressions
Parameters:
Name Type Attributes Default Description
comp CompItem <optional>
The composition containing the locators
disable boolean <optional>
true Wether to disable the expressions after having applied the values

static extractLocator(locator, preCompLayer, useMasterPropertiesopt) → {AVLayer}

Extracts one locator from a precomposition
Parameters:
Name Type Attributes Default Description
locator AVLayer The locator to extract
preCompLayer AVLayer The precomposition layer
useMasterProperties 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)
Returns:
AVLayer - The extracted locator

static extractLocators(preCompLayeropt, useMasterPropertiesopt) → {Array.<AVLayer>}

Extracts locators from a precomposition
Parameters:
Name Type Attributes Default Description
preCompLayer AVLayer <optional>
The precomposition layer
useMasterProperties boolean <optional>
false true to extract using master properties instead of expressions (only in Ae > 15.1 CC2018)
Returns:
Array.<AVLayer> - The extracted locators

static fkOverlap(layers, controlleropt) → {Controller}

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

static getConnectorLayer(compopt) → {AVLayer}

Gets (or create) the controller layer for the connectors of the comp
Parameters:
Name Type Attributes Description
comp CompItem <optional>
The comp. The active composition by default.
Returns:
AVLayer - The connector layer

static ik(layers, controlleropt, forceBezieropt, threeAsOneAndTwoopt) → {Array.<Controller>}

Creates an IK and its controller on the layers/the structure.
Parameters:
Name Type Attributes Default Description
layers Array.<Layer> | Structure The layers, already parented or ordered from goal (at index 0) to root (including the goal)
controller Layer | Controller | null <optional>
An already existing controller.
forceBezier boolean <optional>
false force the use of a bezier IK even with two or three layers
threeAsOneAndTwo boolean <optional>
true when rigging three layers, true to rig using a one-layer IK followed by a two-layer IK instead of a three-mayer IK
Returns:
Array.<Controller> - The controller(s) of the IK.

static oneLayerIK(layer, goalopt, controlleropt) → {Controller}

Creates a one-layer-ik on the layer
Parameters:
Name Type Attributes 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
Returns:
Controller - The controller created

static orientationConstraint(layer)

Adds an orientation constraint to a layer
Parameters:
Name Type Description
layer Layer The layer

static parent(children, parent, useMasterPropertiesopt)

Parents two layers even if the parent is in the parent comp or a precomp.
Parameters:
Name Type Attributes Default Description
children Array.<Layer> The child layer(s)
parent Layer The parent layer
useMasterProperties boolean <optional>
true Only when the parent is in the precomposition (and not a "parent" composition), true to use 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)

static parentConstraint(layer)

Adds a parent constraint to a layer
Parameters:
Name Type Description
layer Layer The layer

static pathConstraint(layer, path)

Adds a path constraint to a layer
Parameters:
Name Type Description
layer Layer The layer
path Property | PropertyInfo The path property

static positionConstraint(layer)

Adds a position constraint to a layer
Parameters:
Name Type Description
layer Layer The layer

static quickConnector(childProps)

Applies connector to the property, creating a controller layer (or using any existing one) with a slider in the effects
Parameters:
Name Type Description
childProps Array.<Property> | Array.<PropertyInfo> The child property

static separateDimensions(prop) → {Array.<PropertyInfo>}

Separates the dimensions of the properties into an effect.
Works with 2D, 3D, and colors
Parameters:
Name Type Description
prop Property | PropertyInfo The property
Returns:
Array.<PropertyInfo> - The seperated properties (or the original one if it could not be separated)

static threeLayerIK(layer1, layer2, layer3, goalopt, controlleropt) → {Controller}

Creates a three-layer-ik on the layer
Parameters:
Name Type Attributes 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 | Controller | null <optional>
The layer to use as a controller, can be automatically created.
Must be provided if goal is undefined
Returns:
Controller - The controller created

static twoLayerIK(layer1, layer2, goalopt, controlleropt) → {Controller}

Creates a two-layer-ik on the layer
Parameters:
Name Type Attributes 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 | Controller | null <optional>
The layer to use as a controller, can be automatically created.
Must be provided if goal is undefined
Returns:
Controller - The controller created