Preparing search index...

    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)

    Index

    Properties

    animation: AnimationAsset

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

    Lens Scripting Version 253

    null
    
    begin: number

    Returns begin time of clip (in seconds).

    Lens Scripting Version 253

    0
    

    The blend mode for this particular clip.

    Lens Scripting Version 253

    AnimationLayerBlendMode.Default
    
    disabled: boolean

    Whether the animation clip is disabled.

    Lens Scripting Version 253

    false
    
    duration: number

    Returns the duration of the clip which is calculated based on the begin and end times (in seconds).

    Lens Scripting Version 253

    end: number

    Returns end time of clip (in seconds).

    Lens Scripting Version 253

    0
    
    name: string

    Name of the clip.

    Lens Scripting Version 253

    offset: number

    The offset (in seconds) which is the starting point for an animation. After the first iteration, it starts back at the beginning of the clip.

    Lens Scripting Version 309

    0
    
    playbackMode: PlaybackMode

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

    Lens Scripting Version 253

    PlaybackMode.Loop
    
    playbackSpeed: number

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

    Lens Scripting Version 253

    1
    
    reversed: boolean

    Specifies if the clip should be played reversed.

    Lens Scripting Version 253

    false
    

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

    Lens Scripting Version 253

    AnimationLayerScaleMode.Multiply
    
    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.

    Lens Scripting Version 253

    1
    

    Methods

    • Clones the existing clip with a new name.

      Parameters

      • clipName: string

      Returns AnimationClip

      Lens Scripting Version 253

    • Creates a clip.

      Parameters

      • clipName: string

      Returns AnimationClip

      Lens Scripting Version 253

    • 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