API

Class AnimationAssetTask

Define a task used by AssetsManager to load animations

Hierarchy (View Summary)

Index
  • Creates a new AnimationAssetTask

    Parameters

    • name: string

      defines the name of the task

    • rootUrl: string

      defines the root url to use as a base to load your meshes and associated resources

    • filename: string | File

      defines the filename or File of the scene to load from

    • OptionaltargetConverter: Nullable<(target: any) => any>

      defines a function used to convert animation targets from loaded scene to current scene (default: search node by name)

    • Optionalextension: string

      defines the extension to use to load the scene (if not defined, ".babylon" will be used)

    Returns AnimationAssetTask

extension?: string

Defines the extension to use to load the scene (if not defined, ".babylon" will be used)

filename: string | File

Defines the filename to load from

loadedAnimatables: Animatable[]

Gets the list of loaded animatables

loadedAnimationGroups: AnimationGroup[]

Gets the list of loaded animation groups

name: string

Defines the name of the task

onError: (task: AnimationAssetTask, message?: string, exception?: any) => void

Callback called when the task is successful

onSuccess: (task: AnimationAssetTask) => void

Callback called when the task is successful

rootUrl: string

Defines the root url to use as a base to load your meshes and associated resources

targetConverter?: Nullable<(target: any) => any>

Defines a function used to convert animation targets from loaded scene to current scene (default: search node by name)

  • get errorObject(): { exception?: any; message?: string }

    Gets the current error object (if task is in error)

    Returns { exception?: any; message?: string }

  • Execute the current task

    Parameters

    • scene: Scene

      defines the scene where you want your assets to be loaded

    • onSuccess: () => void

      is a callback called when the task is successfully executed

    • onError: (message?: string, exception?: any) => void

      is a callback called if an error occurs

    Returns void

  • Execute the current task

    Parameters

    • scene: Scene

      defines the scene where you want your assets to be loaded

    • onSuccess: () => void

      is a callback called when the task is successfully executed

    • onError: (message?: string, exception?: any) => void

      is a callback called if an error occurs

    Returns void