API

Class MeshAssetTask

Define a task used by AssetsManager to load meshes

Hierarchy (View Summary)

Index
  • Creates a new MeshAssetTask

    Parameters

    • name: string

      defines the name of the task

    • meshesNames: any

      defines the list of mesh's names you want to load

    • rootUrl: string

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

    • sceneFilename: string | File

      defines the filename or File of the scene to load from

    • Optionalextension: string

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

    • OptionalfileName: string

      defines the name of the file, if the data is binary

    • OptionalpluginOptions: { [key: string]: { enabled?: boolean; [key: string]: unknown } | undefined }

      defines the options to use with the plugin

    Returns MeshAssetTask

extension?: string

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

fileName?: string

defines the name of the file, if the data is binary

loadedAnimationGroups: AnimationGroup[]

Gets the list of loaded animation groups

loadedMeshes: AbstractMesh[]

Gets the list of loaded meshes

loadedParticleSystems: IParticleSystem[]

Gets the list of loaded particle systems

loadedSkeletons: Skeleton[]

Gets the list of loaded skeletons

loadedTransformNodes: TransformNode[]

Gets the list of loaded transforms

meshesNames: any

Defines the list of mesh's names you want to load

name: string

Defines the name of the task

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

Callback called when the task is successful

onSuccess: (task: MeshAssetTask) => void

Callback called when the task is successful

pluginOptions?: {
    [key: string]: { enabled?: boolean; [key: string]: unknown } | undefined;
}

defines the options to use with the plugin

rootUrl: string

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

sceneFilename: string | File

Defines the filename or File of the scene to load from

  • 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