DuAEF.Interchange.animation

Animation interchange tools

Methods

static cleanAnimExportData(data) → {object}

Cleans data from an After Effects animation before exporting it.
This is a low-level function which you may need only if building your own export formats.
It cleans the data returned by the "getAnim" functions (see DuAEF.DuAE.Layer.getAnim, DuAEF.DuAE.Layer.getAnims, DuAEF.DuAE.Property.getAnim) to be able to store it in a text file.
Parameters:
Name Type Description
data object The animation
Returns:
object - The data cleaned

static cleanAnimImportData(data) → {object}

Cleans data from a JSON before loading it.
This is a low-level function which you may need only if building your own import formats.
It cleans the data stored after having used DuAEF.Interchange.animation.cleanAnimExportData
to be able to set the animations using the "setAnim" functions (see DuAEF.DuAE.Layer.setAnim, DuAEF.DuAE.Property.setAnim).
Parameters:
Name Type Description
data object The animation
Returns:
object - The data cleaned

static cleanKeyframeImportData(keyframeData) → {object}

Cleans data from a JSON before loading it.
This is a low-level function which you may need only if building your own import formats.
It cleans the data stored after having used DuAEF.Interchange.animation.cleanAnimExportData
to be able to set the animations using the "setAnim" functions (see DuAEF.DuAE.Layer.setAnim, DuAEF.DuAE.Property.setAnim).
Parameters:
Name Type Description
keyframeData object The keyframe data which is being loaded
Returns:
object - The data cleaned

static exportAnimToJson(file, layers, selectedKeysOnlyopt, timeRangeopt) → {Array}

Copies all the animations on selected layers, and saves them to a Json file.
Parameters:
Name Type Attributes Default Description
file File The file to save the data
layers Array An array of Layers or LayerCollection with the animation
selectedKeysOnly boolean <optional>
false Wether to copy only selected keys or not
timeRange Array.<float> <optional>
The time range, an array of two time values, in seconds.
Returns:
Array - An array of LayerAnim, the animations

static keyframeInterpolationNameToType(name) → {KeyframeInterpolationType}

Gets the After Effects interpolation type with its name.
This is a low-level function which you should not need.
It used by DuAEF.Interchange.cleanAnimImportData to set interpolation from their names.
Parameters:
Name Type Description
name string The interpolation name
Returns:
KeyframeInterpolationType - The interpolation type or null if not found

static keyframeInterpolationTypeToName(type) → {string}

Gets the name of an After Effects interpolation type.
This is a low-level function which you should not need.
It used by DuAEF.Interchange.cleanAnimExportData to store interpolation with their names.
Parameters:
Name Type Description
type KeyframeInterpolationType The After Effects interpolation type
Returns:
string - The interpolation name or empty string if not found

static loadAnimFromJson(file) → {Array}

Loads the animation from a JSON file, and returns them.
Parameters:
Name Type Description
file File The file to import
Returns:
Array - An array of LayerAnim