AnimationUtility

Editor utility functions for modifying animation clips

Note: This is an editor class. To use it you have to place your script in Assets/Editor inside your project folder. Editor classes are in the UnityEditor namespace so for C# scripts you need to add "using UnityEditor;" at the beginning of the script.

Class Functions
GetAnimationClips

Returns the array of AnimationClips that are referenced in the Animation component

SetAnimationClips

Sets the array of AnimationClips to be referenced in the Animation component

GetAnimatableObjects

Returns a list of animatable objects attached to the game object (includes materials)

GetAnimatablePropertiesForObject

Returns a list of animatable properties for a specific animated object that is attached to gameObject

GetAnimatableProperties

Retrieves all animatable properties of all components / materials attached to the game object

GetFloatValue

Retrieves the current float value by sampling a curve value on a specific game object

GetAllCurves

Retrieves all curves from a specific animation clip.

GetEditorCurve

Unity automatic combines position curves, scale curves, rotation curves internally.

SetEditorCurve

Unity automatic combines position curves, scale curves, rotation curves internally.

GetAnimationEvents

Retrieves all animation events associated with the animation clip

SetAnimationEvents

Replaces all animation events in the animation clip

CalculateTransformPath

Calculates path from root transform to target transform.

StartAnimationMode

Starts animation mode, as used by the animation editor.

StopAnimationMode

Stops animation mode, as used by the animation editor.

InAnimationMode

Returns true if the editor is currently in animation mode.

IsValidPolynomialCurve

ConstrainToPolynomialCurve