ProtoTwin API
    Preparing search index...

    Class Timeline

    Class representing a list of animation keyframes.

    Index

    Constructors

    Accessors

    • get length(): number

      The number of keyframes.

      Returns number

    Methods

    • Adds a keyframe to the timeline.

      Parameters

      • position: Vec3

        The local position for the keyframe.

      • rotation: Quat

        The local rotation for the keyframe.

      • scale: number

        The local scale for the keyframe.

      • transition: Transition

        The interpolation mode for the keyframe.

      • time: number

        The time (milliseconds) for the keyframe in the timeline.

      Returns boolean

      True if the keyframe was added, false otherwise.

    • The position for the keyframe at the specified index.

      Parameters

      • index: number

        The keyframe index.

      Returns Vec3

      The local position.

    • Removes the keyframe at the specified time.

      Parameters

      • time: number

        The time for the keyframe that should be removed.

      Returns boolean

      True if the keyframe was removed, false otherwise.

    • The rotation for the keyframe at the specified index.

      Parameters

      • index: number

        The keyframe index.

      Returns Quat

      The local rotation.

    • The scale for the keyframe at the specified index.

      Parameters

      • index: number

        The keyframe index.

      Returns number

      The local scale.

    • Sets the interpolation mode for the keyframe at the specified index.

      Parameters

      • index: number

        The keyframe index.

      • transition: Transition

        The interpolation mode.

      Returns boolean

      True if the keyframe interpolation mode was changed, false otherwise.

    • The time for the keyframe at the specified index.

      Parameters

      • index: number

        The keyframe index.

      Returns number

      The time (milliseconds).

    • The interpolation mode for the keyframe at the specified index.

      Parameters

      • index: number

        The keyframe index.

      Returns Transition

      The interpolation mode.