API

Class Animation

Class used to store any kind of animation

Index
  • Initializes the animation

    Parameters

    • name: string

      Name of the animation

    • targetProperty: string

      Property to animate

    • framePerSecond: number

      The frames per second of the animation

    • dataType: number

      The data type of the animation

    • OptionalloopMode: number

      The loop mode of the animation

    • OptionalenableBlending: boolean

      Specifies if blending should be enabled

    Returns Animation

blendingSpeed: number = 0.01

Stores the blending speed of the animation

dataType: number

The data type of the animation

enableBlending?: boolean

Specifies if blending should be enabled

framePerSecond: number

The frames per second of the animation

loopMode?: number

The loop mode of the animation

name: string

Name of the animation

snippetId: string

Snippet ID if the animation was created from the snippet server

targetProperty: string

Property to animate

targetPropertyPath: string[]

Stores an array of target property paths

uniqueId: number

Gets or sets the unique id of the animation (the uniqueness is solely among other animations)

AllowMatricesInterpolation: boolean = false

Use matrix interpolation instead of using direct key value when animating matrices

AllowMatrixDecomposeForInterpolation: boolean = true

When matrix interpolation is enabled, this boolean forces the system to use Matrix.DecomposeLerp instead of Matrix.Lerp. Interpolation is more precise but slower

ANIMATIONLOOPMODE_CONSTANT: 2

Constant Loop Mode

ANIMATIONLOOPMODE_CYCLE: 1

Cycle Loop Mode

ANIMATIONLOOPMODE_RELATIVE: 0

Relative Loop Mode

ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT: 5

Relative Loop Mode (add to current value of animated object, unlike ANIMATIONLOOPMODE_RELATIVE)

ANIMATIONLOOPMODE_YOYO: 4

Yoyo Loop Mode

ANIMATIONTYPE_COLOR3: 4 = Constants.ANIMATIONTYPE_COLOR3

Color3 animation type

ANIMATIONTYPE_COLOR4: 7 = Constants.ANIMATIONTYPE_COLOR4

Color3 animation type

ANIMATIONTYPE_FLOAT: 0 = Constants.ANIMATIONTYPE_FLOAT

Float animation type

ANIMATIONTYPE_MATRIX: 3 = Constants.ANIMATIONTYPE_MATRIX

Matrix animation type

ANIMATIONTYPE_QUATERNION: 2 = Constants.ANIMATIONTYPE_QUATERNION

Quaternion animation type

ANIMATIONTYPE_SIZE: 6 = Constants.ANIMATIONTYPE_SIZE

Size animation type

ANIMATIONTYPE_VECTOR2: 5 = Constants.ANIMATIONTYPE_VECTOR2

Vector2 animation type

ANIMATIONTYPE_VECTOR3: 1 = Constants.ANIMATIONTYPE_VECTOR3

Vector3 animation type

InheritOriginalValueFromActiveAnimations: boolean = false

When true, starting a new animation on a property that is already being animated will inherit the original value from the active animation instead of snapshotting the current (mid-animation) value. This prevents properties (e.g. morph target influence) from permanently sticking at intermediate values when animations overlap or interrupt each other.

SnippetUrl: string = Constants.SnippetUrl

Define the Url to load snippets

  • Makes a copy of the animation

    Parameters

    • cloneKeys: boolean = false

      Whether to clone the keys or not (default is false, so the keys are not cloned). Note that the key array itself is always cloned (that is, a new array is created), but the individual keys inside the array are only cloned if this parameter is true.

    Returns Animation

    Cloned animation

  • Interpolates a Color3 cubically

    Parameters

    • startValue: Color3

      Start value of the animation curve

    • outTangent: Color3

      End tangent of the animation

    • endValue: Color3

      End value of the animation curve

    • inTangent: Color3

      Start tangent of the animation curve

    • gradient: number

      Scalar amount to interpolate

    Returns Color3

    interpolated value

  • Interpolates a Color4 cubically

    Parameters

    • startValue: Color4

      Start value of the animation curve

    • outTangent: Color4

      End tangent of the animation

    • endValue: Color4

      End value of the animation curve

    • inTangent: Color4

      Start tangent of the animation curve

    • gradient: number

      Scalar amount to interpolate

    Returns Color4

    interpolated value

  • Creates a key for the frame passed as a parameter and adds it to the animation IF a key doesn't already exist for that frame

    Parameters

    • frame: number

      Frame number

    Returns number

    The key index if the key was added or the index of the pre existing key if the frame passed as parameter already has a corresponding key

  • Creates an animation range

    Parameters

    • name: string

      Name of the animation range

    • from: number

      Starting frame of the animation range

    • to: number

      Ending frame of the animation

    Returns void

  • Deletes an animation range by name

    Parameters

    • name: string

      Name of the animation range to delete

    • deleteFrames: boolean = true

      Specifies if the key frames for the range should also be deleted (true) or not (false)

    Returns void

  • Interpolates a scalar linearly

    Parameters

    • startValue: number

      Start value of the animation curve

    • endValue: number

      End value of the animation curve

    • gradient: number

      Scalar amount to interpolate

    Returns number

    Interpolated scalar value

  • Interpolates a scalar cubically

    Parameters

    • startValue: number

      Start value of the animation curve

    • outTangent: number

      End tangent of the animation

    • endValue: number

      End value of the animation curve

    • inTangent: number

      Start tangent of the animation curve

    • gradient: number

      Scalar amount to interpolate

    Returns number

    Interpolated scalar value

  • Defines the function to use to interpolate matrices

    Parameters

    • startValue: Matrix

      defines the start matrix

    • endValue: Matrix

      defines the end matrix

    • gradient: number

      defines the gradient between both matrices

    • Optionalresult: Matrix

      defines an optional target matrix where to store the interpolation

    Returns Matrix

    the interpolated matrix

  • Sets the key frames of the animation

    Parameters

    • values: IAnimationKey[]

      The animation key frames to set

    • dontClone: boolean = false

      Whether to clone the keys or not (default is false, so the array of keys is cloned)

    • cloneKeys: boolean = false

      Whether to clone the individual keys inside the array or not (default is false). If true, each key object inside the array will be cloned, and the fields that have a clone() method will be cloned by calling that method.

    Returns void

  • Interpolates a size linearly

    Parameters

    • startValue: Size

      Start value of the animation curve

    • endValue: Size

      End value of the animation curve

    • gradient: number

      Scalar amount to interpolate

    Returns Size

    Interpolated Size value

  • Converts the animation to a string

    Parameters

    • OptionalfullDetails: boolean

      support for multiple levels of logging within scene loading

    Returns string

    String form of the animation