## Duik.Animation

The animator's toolkit.

View Source Duik_api_fordoc.jsxinc, line 55144

# Methods

#### # static addContinuousKey(animatedPropsopt, selectedLayersopt)

Adds a Continuous key to the properties at current time

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`animatedProps` | `Bool` | <optional> | true | Set to false to add a key to all selected properties, instead of all animated properties.
`selectedLayers` | `Bool` | <optional> | true | Set to false to add a key to all layers instead of just the selection.

View Source Duik_api_fordoc.jsxinc, line 55999

#### # static addEaseInKey(animatedPropsopt, selectedLayersopt, easeopt)

Adds an Ease In key to the properties at current time

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`animatedProps` | `Bool` | <optional> | true | Set to false to add a key to all selected properties, instead of all animated properties.
`selectedLayers` | `Bool` | <optional> | true | Set to false to add a key to all layers instead of just the selection.
`ease` | `int` | <optional> | 33 | The ease influence.

View Source Duik_api_fordoc.jsxinc, line 55843

#### # static addEaseOutKey(animatedPropsopt, selectedLayersopt, easeopt)

Adds an Ease Out key to the properties at current time

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`animatedProps` | `Bool` | <optional> | true | Set to false to add a key to all selected properties, instead of all animated properties.
`selectedLayers` | `Bool` | <optional> | true | Set to false to add a key to all layers instead of just the selection.
`ease` | `int` | <optional> | 33 | The ease influence.

View Source Duik_api_fordoc.jsxinc, line 55894

#### # static addEasyEaseKey(animatedPropsopt, selectedLayersopt, easeInopt, easeOutopt)

Adds an Easy Ease key to the properties at current time

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`animatedProps` | `Bool` | <optional> | true | Set to false to add a key to all selected properties, instead of all animated properties.
`selectedLayers` | `Bool` | <optional> | true | Set to false to add a key to all layers instead of just the selection.
`easeIn` | `int` | <optional> | 33 | The ease in influence.
`easeOut` | `int` | <optional> | 33 | The ease out influence.

View Source Duik_api_fordoc.jsxinc, line 55946

#### # static addHoldKey(animatedPropsopt, selectedLayersopt)

Adds a Hold key to the properties at current time

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`animatedProps` | `Bool` | <optional> | true | Set to false to add a key to all selected properties, instead of all animated properties.
`selectedLayers` | `Bool` | <optional> | true | Set to false to add a key to all layers instead of just the selection.

View Source Duik_api_fordoc.jsxinc, line 56045

#### # static addLinearKey(animatedPropsopt, selectedLayersopt)

Adds a linear key to the properties at current time

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`animatedProps` | `Bool` | <optional> | true | Set to false to add a key to all selected properties, instead of all animated properties.
`selectedLayers` | `Bool` | <optional> | true | Set to false to add a key to all layers instead of just the selection.

View Source Duik_api_fordoc.jsxinc, line 55796

#### # static addRovingKey(animatedPropsopt, selectedLayersopt)

Adds a roving key to the properties at current time

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`animatedProps` | `Bool` | <optional> | true | Set to false to add a key to all selected properties, instead of all animated properties.
`selectedLayers` | `Bool` | <optional> | true | Set to false to add a key to all layers instead of just the selection.

View Source Duik_api_fordoc.jsxinc, line 55750

#### # static celOnionSkin(enabledopt, framesopt, exposureopt, inOpacityopt, outOpacityopt)

(De)activates or updates the onion skin of a Duik cel animation comp.

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`enabled` | `Boolean` | <optional> | true | If omitted, will try to get it from the existing cels.
`frames` | `int` | <optional> | 5 | The duration (in frames) of the onion skin. If omitted, will try to get it from the existing cels.
`exposure` | `int` | <optional> | 2 | The animation exposure. If omitted, will try to get it from the existing cels.
`inOpacity` | `float` | <optional> | 50 | The in opacity. If omitted, will try to get it from the existing cels.
`outOpacity` | `float` | <optional> | 50 | The out opacity. If omitted, will try to get it from the existing cels.

View Source Duik_api_fordoc.jsxinc, line 56393

#### # static copy(compopt) → {Array.<DuAELayerAnimation>}

Copies the currently selected keyframes, which can then be pasted with `Duik.Animation.paste`.

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`comp` | `CompItem` | <optional> | DuAEProject.getActiveComp | The composition

View Source Duik_api_fordoc.jsxinc, line 55246

Returns:
The list of animations which have been copied.
Type: `Array.<DuAELayerAnimation>`

#### # static cut(compopt) → {Array.<DuAELayerAnimation>}

Cuts the currently selected keyframes, which can then be pasted with `Duik.Animation.paste`.

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`comp` | `CompItem` | <optional> | DuAEProject.getActiveComp | The composition

View Source Duik_api_fordoc.jsxinc, line 55274

Returns:
The list of animations which have been copied.
Type: `Array.<DuAELayerAnimation>`

#### # static fixSpatialInterpolation()

Sets the selected keyframes spatial interpolation to linear

View Source Duik_api_fordoc.jsxinc, line 56181

#### # static freezePose(animatedPropsopt, selectedLayersopt, useNextPoseopt)

Freezes the pose; copies the previous keyframe to the current time.

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`animatedProps` | `Bool` | <optional> | true | Set to false to add a key to all selected properties, instead of all animated properties.
`selectedLayers` | `Bool` | <optional> | true | Set to false to add a key to all layers instead of just the selection.
`useNextPose` | `Bool` | <optional> | false | If true, will freeze the next pose instead of the previous one (copies the next keyframe to the current time).

View Source Duik_api_fordoc.jsxinc, line 56339

#### # static interpolator(propsopt, effectopt) → {PropertyGroup}

Control the selected keyframes with advanced but easy-to-use keyframe interpolation driven by an effect.

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`props` | `Array.<PropertyBase>` | `DuList.<PropertyBase>` | `PropertyBase` | <optional> | The properties to interpolate. The selected properties in the active comp if omitted.
`effect` | `PropertyGroup` | <optional> | The pseudo effect to use if it already exists.

View Source Duik_api_fordoc.jsxinc, line 55322

Returns:
The pseudo-effect
Type: `PropertyGroup`

#### # static newCel(createNewLayeropt)

Creates a new cel for a Duik cel animation

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`createNewLayer` | `Boolean` | <optional> | false | Set to true to create the cel on a new layer

View Source Duik_api_fordoc.jsxinc, line 56593

#### # static nextCel(exposureopt)

Goes to the next frame in a Duik cel animation

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`exposure` | `int` | <optional> | 2 | The animation exposure

View Source Duik_api_fordoc.jsxinc, line 56657

#### # static paste(compopt, replaceopt, offsetopt, reverseopt, matchNamesopt)

Pastes the animation previously copied by `Duik.Animation.copy` to the selected properties.

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`comp` | `CompItem` | <optional> |  | The composition.
`replace` | `Boolean` | <optional> | false | Whether to completely erase and replace the current animation
`offset` | `Boolean` | <optional> | false | Whether to offset the animation from the current value
`reverse` | `Boolean` | <optional> | false | Whether to reverse the animation
`matchNames` | `Array.<string>` | <optional> | [] | A filter to apply only on specific property types

View Source Duik_api_fordoc.jsxinc, line 55310

#### # static previousCel(exposureopt)

Goes to the previous frame in a Duik cel animation

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`exposure` | `int` | <optional> | 2 | The animation exposure

View Source Duik_api_fordoc.jsxinc, line 56639

#### # static selectKeyframes(compopt, selectedLayersopt, controllersOnlyopt, rangeopt, propertyMatchNamesopt)

Selects the keyframes in the comp

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`comp` | `CompItem` | <optional> | DuAEProject.getActiveComp | The composition
`selectedLayers` | `Boolean` | <optional> | false | Set to true to get the keyframes only on the selected layers instead of all the layers.
`controllersOnly` | `Boolean` | <optional> | true | Set to false to get the keyframes from all types of layers instead of just the controllers.
`range` | `Array.<float>` | <optional> |  | The time range to select the keyframes, [in, out]. If omitted, will use the work area of the composition.
`propertyMatchNames` | `Array.<string>` | <optional> | [] | The list of matchnames to select only keyframes of a specific type. If empty, will select all types of keyframes.

View Source Duik_api_fordoc.jsxinc, line 55164

#### # static sequenceKeys(durationopt, reverseopt, interpolationopt)

Sequences selected keyframes.

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`duration` | `int` | <optional> | 24 | The transition duration, in frames
`reverse` | `Bool` | <optional> | false | Set to true to reverse the order.
`interpolation` | `function` | <optional> | DuInterpolation.linear | An interpolation function, taking 4 arguments in the form `i(value, min, max, targetMin, targetMax)`

View Source Duik_api_fordoc.jsxinc, line 56807

#### # static sequenceLayers(durationopt, moveLayersopt, useInPointsopt, reverseopt, interpolationopt)

Sequences selected layers.

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`duration` | `int` | <optional> | 24 | The transition duration, in frames
`moveLayers` | `Bool` | <optional> | true | If set to false, the layer are not moved, and the in or out points are changed instead (layers are "cut")
`useInPoints` | `Bool` | <optional> | true | If moveLayers is false, setting this to false changes the out points instead of the in points (cuts the end instead of the start).
`reverse` | `Bool` | <optional> | false | Set to true to reverse the order.
`interpolation` | `function` | <optional> | DuInterpolation.linear | An interpolation function, taking 4 arguments in the form `i(value, min, max, targetMin, targetMax)`

View Source Duik_api_fordoc.jsxinc, line 56758

#### # static setContinuous()

Sets the selected keyframes to continuous

View Source Duik_api_fordoc.jsxinc, line 56024

#### # static setEase(easeIn, easeOut)

Sets the ease values on the selected keyframes

##### Parameters:

Name | Type | Description
--- | --- | ---
`easeIn` | `float` | The in ease
`easeOut` | `float` | The out ease

View Source Duik_api_fordoc.jsxinc, line 56090

#### # static setEaseIn(easeopt)

Sets the selected keyframes to ease in

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`ease` | `int` | <optional> | 33 | The ease influence.

View Source Duik_api_fordoc.jsxinc, line 55870

#### # static setEaseOut(easeopt)

Sets the selected keyframes to ease out

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`ease` | `int` | <optional> | 33 | The ease influence.

View Source Duik_api_fordoc.jsxinc, line 55921

#### # static setEasyEase(easeInopt, easeOutopt)

Sets the selected keyframes to easy ease

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`easeIn` | `int` | <optional> | 33 | The ease in influence.
`easeOut` | `int` | <optional> | 33 | The ease out influence.

View Source Duik_api_fordoc.jsxinc, line 55975

#### # static setHold()

Sets the selected keyframes to hold

View Source Duik_api_fordoc.jsxinc, line 56070

#### # static setLinear()

Sets the selected keyframes to linear

View Source Duik_api_fordoc.jsxinc, line 55821

#### # static setRoving()

Sets the selected keyframes to roving

View Source Duik_api_fordoc.jsxinc, line 55775

#### # static setSpatialBezier()

Sets the selected keyframes spatial interpolation to linear

View Source Duik_api_fordoc.jsxinc, line 56173

#### # static setSpatialBezierIn()

Sets the selected keyframes spatial interpolation to linear

View Source Duik_api_fordoc.jsxinc, line 56157

#### # static setSpatialBezierOut()

Sets the selected keyframes spatial interpolation to linear

View Source Duik_api_fordoc.jsxinc, line 56165

#### # static setSpatialInterpolation()

Sets the selected keyframes spatial interpolation

View Source Duik_api_fordoc.jsxinc, line 56128

#### # static setSpatialLinear()

Sets the selected keyframes spatial interpolation to linear

View Source Duik_api_fordoc.jsxinc, line 56149

#### # static setVelocity(vIn, vOut)

Sets the velocity values on the selected keyframes

##### Parameters:

Name | Type | Description
--- | --- | ---
`vIn` | `float` | The in velocity
`vOut` | `float` | The out velocity

View Source Duik_api_fordoc.jsxinc, line 56110

#### # static snapFK(ctrlsopt)

Snaps the FK to the IK values.

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`ctrls` | `Array.<Layer>` | `DuList.<Layer>` | <optional> | The controllers to snap.

View Source Duik_api_fordoc.jsxinc, line 57089

#### # static snapIK(ctrlsopt)

Snaps the IK to the FK values.

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`ctrls` | `Array.<Layer>` | `DuList.<Layer>` | <optional> | The controllers to snap.

View Source Duik_api_fordoc.jsxinc, line 56998

#### # static snapKeys()

Snaps selected (or all) keyframes to the closest frames if they're in between.

View Source Duik_api_fordoc.jsxinc, line 56674

#### # static splitKeys(durationopt, alignmentopt)

Splits the selected keyframes into couple of keyframes with the same values

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`duration` | `int` | <optional> | 2 | The number of frames between the two keyframes.
`alignment` | `DuAE.TimeAlignment` | <optional> | DuAE.TimeAlignment.CENTER | How to align the new keyframes according to the current time.

View Source Duik_api_fordoc.jsxinc, line 56255

#### # static switchIKFK(ctrlsopt, addKeyframesopt)

Switches between IK and FK.

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`ctrls` | `Array.<Layer>` | `DuList.<Layer>` | <optional> |  | The controllers to switch.
`addKeyframes` | `bool` | <optional> | true | Whether to add keyframes on FK and IK properties to keep the switch at the current frame.

View Source Duik_api_fordoc.jsxinc, line 57145

#### # static syncKeys(onLastopt)

Syncs the selected keyframes; moves them to the current time.< br /> If multiple keyframes are selected for the same property, they're offset to the current time, keeping the animation.

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`onLast` | `Boolean` | <optional> | false | If true, syncs using the last keyframe instead of the first

View Source Duik_api_fordoc.jsxinc, line 56713

#### # static tween(tweenRatioopt, animatedPropsopt, selectedLayersopt)

Adds a key to the properties at current time, tweening according to the previous and next keyframe

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`tweenRatio` | `float` | <optional> | 0.5 | The value ratio for tweening: 0.0 is the value of the previous key, 1.0 is the value of the next key. Note that this value can be < 0 and > 1.0 if you wish.
`animatedProps` | `Bool` | <optional> | true | Set to false to add a key to all selected properties, instead of all animated properties.
`selectedLayers` | `Bool` | <optional> | true | Set to false to add a key to all layers instead of just the selection.

View Source Duik_api_fordoc.jsxinc, line 56202

#### # static xSheet(autoComputeopt)

Adjusts the exposure of the animation.

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`autoCompute` | `Bool` | <optional> | false | (Try to) auto-compute the best values..

View Source Duik_api_fordoc.jsxinc, line 56859