Lens Scripting API

    Class AnimationClip

    Animation Clip is what an Animation Player uses to manage playback for a specific animation. It defines that animation by referencing an Animation Asset and providing start and end points, playback speed and direction, and blending information.

    //@input Component.AnimationPlayer animationPlayer
    //@input Asset.AnimationAsset myAnimation

    const myClip = AnimationClip.create("myAnimationClip");
    myClip.animation = script.myAnimation;
    myClip.begin = 0;
    myClip.end = 3.75;
    myClip.weight = 1.0;
    myClip.playbackSpeed = 0.5;
    myClip.playbackMode = PlaybackMode.Loop;
    myClip.reversed = true;
    myClip.disabled = false;

    script.animationPlayer.addClip(myClip);
    script.animationPlayer.playClipAt(myClip.name, 0.0);

    Hierarchy (View Summary, Expand)

    Index

    Constructors

    Properties

    animation: AnimationAsset

    Points to the animation asset to be played by the Animation Player.

    begin: number

    Returns begin time of clip.

    The blend mode for this particular clip.

    disabled: boolean

    Whether the animation clip is disabled.

    duration: number

    Returns the duration of the clip which is calculated based on the begin and end times.

    end: number

    Returns end time of clip.

    name: string

    Name of the clip.

    playbackMode: PlaybackMode

    Choose whether to play animation clip once, loop the clip, or ping pong it.

    playbackSpeed: number

    Scalar value to represent playback speed percentage. 1.0 is 100% playback speed.

    reversed: boolean

    Specifies if the clip should be played reversed.

    How scale is accumulated. Usually does not need to be changed after import.

    weight: number

    Strength of animation clip contribution. Lies between [0.0, 1.0] inclusive. For default blending a 1.0 weight indicates this clip will override all earlier clips, a less than 1.0 weight indicates it will blend onto the calculated pose using a weighted average.

    Methods

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

      Parameters

      • type: string

      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

    MMNEPVFCICPMFPCPTTAAATR