Selva Compute API Reference - v1.1.2
    Preparing search index...

    Represents s a timed sequence of keyframes, which are composed of lists of times and related values, and which are used to animate a specific property of an object.

    Index

    Constructors

    • Constructs a new keyframe track.

      Parameters

      • name: string

        The keyframe track's name.

      • times: ArrayLike<number>

        A list of keyframe times.

      • values: ArrayLike<string | number | boolean>

        A list of keyframe values.

      • Optionalinterpolation: InterpolationModes

        The interpolation type.

      Returns KeyframeTrack

    Properties

    DefaultInterpolation: InterpolationModes

    The default interpolation type of this keyframe track.

    InterpolateLinear
    
    name: string

    The track's name can refer to morph targets or bones or possibly other values within an animated object. See PropertyBinding#parseTrackName for the forms of strings that can be parsed for property binding.

    TimeBufferType: ArrayConstructor | TypedArrayConstructor

    The time buffer type of this keyframe track.

    Float32Array.constructor
    
    times: Float32Array

    The keyframe times.

    ValueBufferType: ArrayConstructor | TypedArrayConstructor

    The value buffer type of this keyframe track.

    Float32Array.constructor
    
    values: Float32Array

    The keyframe values.

    ValueTypeName: string

    The value type name.

    ''
    

    Methods

    • Returns a new keyframe track with copied values from this instance.

      Returns this

      A clone of this instance.

    • Returns the current interpolation type.

      Returns InterpolationModes

      The interpolation type.

    • Returns the value size.

      Returns number

      The value size.

    • Factory method for creating a new discrete interpolant.

      Parameters

      Returns DiscreteInterpolant

      The new interpolant.

    • Factory method for creating a new linear interpolant.

      Parameters

      Returns LinearInterpolant

      The new interpolant.

    • Factory method for creating a new smooth interpolant.

      Parameters

      Returns CubicInterpolant

      The new interpolant.

    • Optimizes this keyframe track by removing equivalent sequential keys (which are common in morph target sequences).

      Returns this

      A reference to this animation clip.

    • Scale all keyframe times by a factor (useful for frame - seconds conversions).

      Parameters

      • timeScale: number

        The time scale.

      Returns KeyframeTrack

      A reference to this keyframe track.

    • Defines the interpolation factor method for this keyframe track.

      Parameters

      Returns KeyframeTrack

      A reference to this keyframe track.

    • Moves all keyframes either forward or backward in time.

      Parameters

      • timeOffset: number

        The offset to move the time values.

      Returns KeyframeTrack

      A reference to this keyframe track.

    • Removes keyframes before and after animation without changing any values within the defined time range.

      Note: The method does not shift around keys to the start of the track time, because for interpolated keys this will change their values

      Parameters

      • startTime: number

        The start time.

      • endTime: number

        The end time.

      Returns KeyframeTrack

      A reference to this keyframe track.

    • Performs minimal validation on the keyframe track. Returns true if the values are valid.

      Returns boolean

      Whether the keyframes are valid or not.

    • Converts the keyframe track to JSON.

      Parameters

      Returns KeyframeTrackJSON

      The serialized keyframe track as JSON.