Lens Scripting API

    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, Expand)

    Index

    Constructors

    Properties

    animationLayerName: string

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

    cycles: number

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

    disabled: boolean

    If true, the animation will stop having an effect.

    fps: number

    The framerate (frames per second) of the animation.

    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.

    name: string

    The name of the AnimationMixerLayer.

    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. This is set to Cycle by default.

    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.

    reversed: boolean

    If true, the animation will play play in reverse.

    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.

    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.

    weight: number

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

    Methods

    • Returns the length of the animation in seconds.

      Returns number

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

      Returns number

    • 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

    • 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

    • Resumes the animation if it has been paused.

      Returns void

    • 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

    • 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

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

      Returns void

    MMNEPVFCICPMFPCPTTAAATR