Lens Scripting API

    Class AnimationAsset

    Represents animation data. Can have multiple AnimationPropertyLayers. Used in AnimationClip.

    AnimationAssets themselves do not handle playing or orchestrating animations. This is left to the AnimationPlayer component to handle.

    // @input Asset.AnimationAsset animAsset
    const startEventName = 'animStarted';
    const startTimestamp = 0;
    const e = script.animAsset.createEvent(startEventName, startTimestamp);
    const endEventName = 'animEnded';
    const endTimestamp = script.animAsset.duration;
    script.animAsset.createEvent(endEventName, endTimestamp);

    Hierarchy (View Summary, Expand)

    Index

    Constructors

    Properties

    duration: number

    Animation duration in seconds.

    fps: number

    Denotes how many key frames this animation was sampled at.

    name: string

    The name of the Asset in Lens Studio.

    uniqueIdentifier: string

    Methods

    • Delete all the AnimationPropertyLayer in this AnimationAsset.

      Returns void

    • Delete the AnimationPropertyLayer named layerName.

      Parameters

      • layerName: string

      Returns void

    • Returns the name of this object's type.

      Returns string

    • 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