Preparing search index...

    Class AnimationMixerLayer

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

    // 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);

    Hierarchy (View Summary)

    Index

    Properties

    animationLayerName: string

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

    ""
    

    Since Lens Scripting Version 307

    Lens Scripting Version 235

    AnimationLayerBlendMode.Default
    

    Since Lens Scripting Version 307

    cycles: number

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

    -1
    

    Since Lens Scripting Version 307

    disabled: boolean

    If true, the animation will stop having an effect.

    false
    

    Since Lens Scripting Version 307

    fps: number

    The framerate (frames per second) of the animation.

    30
    

    Since Lens Scripting Version 307

    from: number

    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.

    0
    

    Since Lens Scripting Version 307

    name: string

    The name of the AnimationMixerLayer.

    ""
    

    Since Lens Scripting Version 307

    postInfinity: PostInfinity

    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.

    AnimationClip.PostInfinity.Cycle
    

    Since Lens Scripting Version 307

    rangeType: RangeType

    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.

    AnimationClip.RangeType.Time
    

    Since Lens Scripting Version 307

    reversed: boolean

    If true, the animation will play play in reverse.

    false
    

    Since Lens Scripting Version 307

    Lens Scripting Version 235

    AnimationLayerScaleMode.Multiply
    

    Since Lens Scripting Version 307

    speedRatio: number

    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.

    1
    

    Since Lens Scripting Version 307

    to: number

    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.

    1
    

    Since Lens Scripting Version 307

    weight: number

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

    0
    

    Since Lens Scripting Version 307

    Methods

    • Returns a copy of this AnimationMixerLayer, with the name changed to newName.

      Parameters

      • newName: string

      Returns AnimationMixerLayer

      Since Lens Scripting Version 307

    • Returns the length of the animation in seconds.

      Returns number

      Since Lens Scripting Version 307

    • Returns the current playback position of the animation in seconds.

      Returns number

      Since Lens Scripting Version 307

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

      Parameters

      • type: string

      Returns boolean

    • Returns whether the animation is currently playing.

      Returns boolean

      Since Lens Scripting Version 307

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

      Parameters

      Returns boolean

    • Pauses the animation.

      Returns void

      Since Lens Scripting Version 307

    • Resumes the animation if it has been paused.

      Returns void

      Since Lens Scripting Version 307

    • 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

      Returns void

      Since Lens Scripting Version 307

    • 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.

      Parameters

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

      Returns void

      Since Lens Scripting Version 307

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

      Returns void

      Since Lens Scripting Version 307