Description

Controls animation playback for a single animation layer. See also: AnimationMixer.

Example

// Double the speed of the first AnimationMixerLayer and play it once
//@input Component.AnimationMixer mixer

var layer = script.mixer.getLayers()[0];
layer.speedRatio = 2.0;
layer.start(0, 1);
interface AnimationMixerLayer {
    animationLayerName: string;
    blendMode: AnimationLayerBlendMode;
    cycles: number;
    disabled: boolean;
    fps: number;
    from: number;
    name: string;
    postInfinity: PostInfinity;
    rangeType: RangeType;
    reversed: boolean;
    scaleMode: AnimationLayerScaleMode;
    speedRatio: number;
    to: number;
    weight: number;
    clone(newName): AnimationMixerLayer;
    getDuration(): number;
    getTime(): number;
    getTypeName(): string;
    isOfType(type): boolean;
    isPlaying(): boolean;
    isSame(other): boolean;
    pause(): void;
    resume(): void;
    start(offset, cycles): void;
    startWithCallback(offset, cycles, eventCallback): void;
    stop(): void;
}

Hierarchy (view full)

Properties

animationLayerName: string

Description

The name of the animation layer being used for this animation.

cycles: number

Description

The number of times this animation will play. If -1, the animation will loop forever.

disabled: boolean

Description

If true, the animation will stop having an effect.

fps: number

Description

The framerate (frames per second) of the animation.

from: number

Description

The starting point for this animation clip. If rangeType is set to Time, this is the point to start at in seconds. If rangeType is set to Frames, this is the frame number to start at.

name: string

Description

The name of the AnimationMixerLayer.

postInfinity: PostInfinity

Description

Defines the animation's looping behavior. If set to AnimationClip.PostInfinity.Cycle, the animation will restart from the beginning each time it loops. If set to AnimationClip.PostInfinity.Oscillate, the animation will switch between normal and reverse playback each time it loops. This is set to Cycle by default.

rangeType: RangeType

Description

The range type used for defining the animation clip. If set to AnimationClip.RangeType.Time, to and from represent times in seconds. If set to AnimationClip.RangeType.Frames, to and from represent frame numbers.

reversed: boolean

Description

If true, the animation will play play in reverse.

speedRatio: number

Description

A multiplying value for the speed of this animation. For example, a value of 2.0 will double animation speed, while a value of 0.5 will cut the speed in half.

to: number

Description

The ending point for this animation clip. If rangeType is set to Time, this is the point to end at in seconds. If rangeType is set to Frames, this is the frame number to end at.

weight: number

Description

The weight of this animation layer. Range is from [0-1], 0 being no animation strength and 1 being full animation strength.

Methods

  • Returns number

    Description

    Returns the length of the animation in seconds.

  • Returns number

    Description

    Returns the current playback position of the animation in seconds.

  • Returns string

    Description

    Returns the name of this object's type.

  • Parameters

    • type: string

    Returns boolean

    Description

    Returns true if the object matches or derives from the passed in type.

  • Returns boolean

    Description

    Returns whether the animation is currently playing.

  • Parameters

    Returns boolean

    Description

    Returns true if this object is the same as other. Useful for checking if two references point to the same thing.

  • Returns void

    Description

    Pauses the animation.

  • Returns void

    Description

    Resumes the animation if it has been paused.

  • Parameters

    • offset: number
    • cycles: number

    Returns void

    Description

    Starts playing the animation with an offset of offsetArg seconds. The animation will play cycles times, or loop forever if cycles is -1.

  • Parameters

    • offset: number
    • cycles: number
    • eventCallback: ((name, animationMixer) => void)
        • (name, animationMixer): void
        • Parameters

          Returns void

    Returns void

    Description

    Starts the animation with an offset of offsetArg seconds. The animation will play cycles times, or loop forever if cycles is -1. eventCallback will be called after the animation finishes.

  • Returns void

    Description

    Stops the animation from playing and jumps to the animation's end.

Generated using TypeDoc