DuAEF.Duik.Animation

Animation tools

Methods

static extractControllersFromComp(preComposition, useMasterPropertiesopt) → {int}

Extracts the controllers from the precomposition,< br/> and copies them to the composition, linking all precomposed controllers
to the new ones.
WARNING This method uses the native copy and paste commands of After Effects,
DO NOT enclose it in an undoGroup.
Undo groups will be handled by this method itself.
Parameters:
Name Type Attributes Default Description
preComposition AVLayer The precomposition layer
useMasterProperties boolean <optional>
true Only in Ae v15.1 (CC2018) and up, true to use Master Properties
instead of expressions to link the controllers. Ignored on previous versions of After Effects.
Returns:
int - Error code:
-3: No controllers found in the precomp
-2: The layer is not a precomposition
-1: Some controllers can not be extracted
0: Unknown error
1: OK

static fk2ik(controller)

Snaps the FK rotation values to the IK position
Parameters:
Name Type Description
controller Controller | Layer The IK Controller

static ik2fk(controller)

Snaps the IK position to the FK rotation values
Parameters:
Name Type Description
controller Controller | Layer The IK Controller

static kleaner(prop, useExpressionopt, easeStartopt, easeEndopt, effectopt) → {PropertyGroup|null}

Automatically adjust the best bezier interpolations on the keyframes
Parameters:
Name Type Attributes Default Description
prop Property | PropertyInfo The property containing the keyframes
useExpression boolean <optional>
true Use an expression instead of using the interpolation of the keyframes
easeStart boolean <optional>
true true to ease the first keyframe, false to set it to linear
easeEnd boolean <optional>
true true to ease the last keyframe, false to set it to linear
effect PropertyGroup <optional>
null A pre-existing kleaner effect to use, when useExpression is true
Returns:
PropertyGroup | null - The effect which controls the expression when useExpression is true
To Do:
  • implement a better multidimensionnal algo

static motionTrail(compopt, layeropt, trailLayeropt, coloropt) → {ShapeLayer}

Creates a motion trail for the layer
Parameters:
Name Type Attributes Default Description
comp CompItem <optional>
The comp where to create the trails, can be omitted if you provide a layer
layer Layer <optional>
The layer source of the motion. If not provided, will just create an empty motion trail control
trailLayer ShapeLayer | null <optional>
An existing shape layer containing the trails
color Array.<float> | null <optional>
DuAEF.DuJS.Color.random() A color for the motion trail. If not provided, random
Returns:
ShapeLayer - The layer containing the motion trail created

static resetPRS(layer) → {AVLayer}

Resets the position, rotation, and scale of the layer.\n If the layer has a parent, the position will be set to [0,0,0], Else it will be set to the composition center.
Parameters:
Name Type Description
layer Layer The layer
Returns:
AVLayer - The zero, a null

static switchIkFk(controller)

Automatically witches between IK and FK
Parameters:
Name Type Description
controller Controller | Layer The IK Controller

static timeRemap(layers, loopInTypeopt, loopOutTypeopt)

Activate the time remapping on the layers, adding some useful controls or expressions
Parameters:
Name Type Attributes Default Description
layers Array.<Layer> | LayerCollection The layers
loopInType DuAEF.DuAE.LoopTypes <optional>
DuAEF.DuAE.LoopTypes.HOLD The type of loopIn
loopOutType DuAEF.DuAE.LoopTypes <optional>
DuAEF.DuAE.LoopTypes.HOLD The type of loopOut

static unExtractControllersFromComp(preComposition)

Un-Extracts the controllers from the precomposition.
Parameters:
Name Type Description
preComposition AVLayer The precomposition layer

static xSheet(comp, propopt, effectopt) → {PropertyGroup}

Adds animation exposure controls
Parameters:
Name Type Attributes Description
comp CompItem The comp where to create the X-Sheet
prop Property | PropertyInfo <optional>
The property controlled. If not provided, will add an X-Sheet adjustment layer in the comp.
effect PropertyGroup | null <optional>
an X-Sheet effect already created to use as a control for the prop
Returns:
PropertyGroup - The effect used to control