RSX Code Reference
    Preparing search index...
    • rsx
    • AnimationClip

    Class AnimationClip

    Contains animation curves for translation/rotation/scale of scene objects/skeleton bones, as well as curves for generic property animation.

    Hierarchy (View Summary)

    Index
    • Creates an animation clip with no curves. After creation make sure to register some animation curves before using it.

      Parameters

      • OptionalisAdditive: boolean

      Returns AnimationClip

    • Creates an animation clip with specified curves.

      Parameters

      • curves: AnimationCurves

        Curves to initialize the animation with.

      • OptionalisAdditive: boolean

        Determines does the clip contain additive curve data. This will change the behaviour how is the clip blended with other animations.

      • OptionalsampleRate: number

        If animation uses evenly spaced keyframes, number of samples per second. Not relevant if keyframes are unevenly spaced.

      • OptionalrootMotion: RootMotion

        Optional set of curves that can be used for animating the root bone. Not used by the animation system directly but is instead provided to the user for manual evaluation.

      • OptionalisInternalConstructor: boolean

      Returns AnimationClip

    • get curves(): AnimationCurves

      A set of all curves stored in the animation. Returned value will not be updated if the animation clip curves are added or removed, as it is a copy of clip's internal values.

      Returns AnimationCurves

    • set curves(value: AnimationCurves): void

      Parameters

      Returns void

    • get hasRootMotion(): boolean

      Checks if animation clip has root motion curves separate from the normal animation curves.

      Returns boolean

    • get isAdditive(): boolean

      Checks are the curves contained within the clip additive. Additive clips are intended to be added on top of other clips.

      Returns boolean

    • get isDestroyed(): boolean

      Determines if the resource is destroyed.

      Returns boolean

      This can happen when the Resource was forcefully unloaded or reverted. For this reason, it is safer to hold on to a instead of directly referencing a resource pointer, as the current Resource can always be retrieved via .value.

    • get length(): number

      Returns the length of the animation clip, in seconds.

      Returns number

    • get name(): string

      Name of the resource. Use primarily for easier identification and not important to the engine itself.

      Returns string

    • get rootMotion(): RootMotion

      Returns a set of curves containing motion of the root bone. This allows the user to evaluate the root bone animation curves manually, instead of through the normal animation process. This property is only available if animation clip was imported with root motion import enabled.

      Returns RootMotion

    • get sampleRate(): number

      Number of samples per second the animation clip curves were sampled at. This value is not used by the animation clip or curves directly since unevenly spaced keyframes are supported. But it can be of value when determining the original sample rate of an imported animation or similar.

      Returns number

    • set sampleRate(value: number): void

      Parameters

      • value: number

      Returns void

    • get uuid(): UUID

      Returns a universally unique identifier of this resource.

      Returns UUID

    • Duplicates the resource and creates a unique UUID for the duplicated resource.

      Returns Resource

      The duplicated resource or null, if the duplication failed.

    • Virtual

      Method called by RSX to perform actions required after the creation of the resource.

      Returns void

    • Virtual

      Method called by RSX to perform any operations needed after deserialization.

      Returns void

      Use this API to restore your serializable data into live objects.

    • Virtual

      Method called by RSX to disable the resource.

      Returns void

      Use this API to deactivate the resource before it is serialized.

    • Virtual

      Method called by RSX to enable the resource.

      Returns void

      Use this API to activate the resource after it has been disabled by serialization.

    • Virtual

      Method called by RSX to perform initialization of the resource.

      Returns void

      Use this API to initialize data and default construct all fields.

    • Virtual

      Method called by RSX to perform any operations before serialization.

      Returns void

      Use this API to bake your live data into serializable data.

    • Rescales the animation clip and all it's curves to match the specified length in seconds.

      Parameters

      • newLength: number

      Returns boolean

      true upon success.

    • Reverts the resource to the on-disk representation.

      Returns boolean

      This is a potentially expensive call, as it needs to deserialize and replace all existing in-memory resource handles.