SceneLoader

Class used to load scene from various file formats using registered plugins

see

http://doc.babylonjs.com/how_to/load_from_any_file_type

Hierarchy

  • SceneLoader

Index

Properties

Static CleanBoneMatrixWeights

Find examples in Playground
CleanBoneMatrixWeights: boolean

Gets or set a boolean indicating if matrix weights must be cleaned upon loading

Static DETAILED_LOGGING

Find examples in Playground
DETAILED_LOGGING: number

Detailled logging while loading

Static ForceFullSceneLoadingForIncremental

Find examples in Playground
ForceFullSceneLoadingForIncremental: boolean

Gets or sets a boolean indicating if entire scene must be loaded even if scene contains incremental data

Static MINIMAL_LOGGING

Find examples in Playground
MINIMAL_LOGGING: number

Minimal logging while loading

Static NO_LOGGING

Find examples in Playground
NO_LOGGING: number

No logging while loading

Static OnPluginActivatedObservable

Find examples in Playground
OnPluginActivatedObservable: Observable<ISceneLoaderPlugin | ISceneLoaderPluginAsync>

Event raised when a plugin is used to load a scene

Static SUMMARY_LOGGING

Find examples in Playground
SUMMARY_LOGGING: number

Summary logging while loading

Static ShowLoadingScreen

Find examples in Playground
ShowLoadingScreen: boolean

Gets or sets a boolean indicating if loading screen must be displayed while loading a scene

Static loggingLevel

Find examples in Playground
loggingLevel: number

Defines the current logging level (while loading the scene)

ignorenaming

Methods

Static Append

Find examples in Playground
  • Append a scene

    Parameters

    • rootUrl: string

      a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)

    • Optional sceneFilename: string | File

      a string that defines the name of the scene file or starts with "data:" following by the stringified version of the scene or a File object (default: empty string)

    • Optional scene: Nullable<Scene>

      is the instance of BABYLON.Scene to append to

    • Optional onSuccess: Nullable<function>

      a callback with the scene when import succeeds

    • Optional onProgress: Nullable<function>

      a callback with a progress event for each file being loaded

    • Optional onError: Nullable<function>

      a callback with the scene, a message, and possibly an exception when import fails

    • Optional pluginExtension: Nullable<string>

      the extension used to determine the plugin

    Returns Nullable<ISceneLoaderPlugin | ISceneLoaderPluginAsync>

    The loaded plugin

Static AppendAsync

Find examples in Playground
  • AppendAsync(rootUrl: string, sceneFilename?: string | File, scene?: Nullable<Scene>, onProgress?: Nullable<function>, pluginExtension?: Nullable<string>): Promise<Scene>
  • Append a scene

    Parameters

    • rootUrl: string

      a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)

    • Optional sceneFilename: string | File

      a string that defines the name of the scene file or starts with "data:" following by the stringified version of the scene or a File object (default: empty string)

    • Optional scene: Nullable<Scene>

      is the instance of BABYLON.Scene to append to

    • Optional onProgress: Nullable<function>

      a callback with a progress event for each file being loaded

    • Optional pluginExtension: Nullable<string>

      the extension used to determine the plugin

    Returns Promise<Scene>

    The given scene

Static GetPluginForExtension

Find examples in Playground

Static ImportMesh

Find examples in Playground
  • Import meshes into a scene

    Parameters

    • meshNames: any

      an array of mesh names, a single mesh name, or empty string for all meshes that filter what meshes are imported

    • rootUrl: string

      a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)

    • Optional sceneFilename: string | File

      a string that defines the name of the scene file or starts with "data:" following by the stringified version of the scene or a File object (default: empty string)

    • Optional scene: Nullable<Scene>

      the instance of BABYLON.Scene to append to

    • Optional onSuccess: Nullable<function>

      a callback with a list of imported meshes, particleSystems, and skeletons when import succeeds

    • Optional onProgress: Nullable<function>

      a callback with a progress event for each file being loaded

    • Optional onError: Nullable<function>

      a callback with the scene, a message, and possibly an exception when import fails

    • Optional pluginExtension: Nullable<string>

      the extension used to determine the plugin

    Returns Nullable<ISceneLoaderPlugin | ISceneLoaderPluginAsync>

    The loaded plugin

Static ImportMeshAsync

Find examples in Playground
  • ImportMeshAsync(meshNames: any, rootUrl: string, sceneFilename?: string | File, scene?: Nullable<Scene>, onProgress?: Nullable<function>, pluginExtension?: Nullable<string>): Promise<object>
  • Import meshes into a scene

    Parameters

    • meshNames: any

      an array of mesh names, a single mesh name, or empty string for all meshes that filter what meshes are imported

    • rootUrl: string

      a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)

    • Optional sceneFilename: string | File

      a string that defines the name of the scene file or starts with "data:" following by the stringified version of the scene or a File object (default: empty string)

    • Optional scene: Nullable<Scene>

      the instance of BABYLON.Scene to append to

    • Optional onProgress: Nullable<function>

      a callback with a progress event for each file being loaded

    • Optional pluginExtension: Nullable<string>

      the extension used to determine the plugin

    Returns Promise<object>

    The loaded list of imported meshes, particle systems, skeletons, and animation groups

Static IsPluginForExtensionAvailable

Find examples in Playground
  • IsPluginForExtensionAvailable(extension: string): boolean
  • Gets a boolean indicating that the given extension can be loaded

    Parameters

    • extension: string

      defines the extension to load

    Returns boolean

    true if the extension is supported

Static Load

Find examples in Playground
  • Load a scene

    Parameters

    • rootUrl: string

      a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)

    • Optional sceneFilename: string | File

      a string that defines the name of the scene file or starts with "data:" following by the stringified version of the scene or a File object (default: empty string)

    • Optional engine: Nullable<Engine>

      is the instance of BABYLON.Engine to use to create the scene

    • Optional onSuccess: Nullable<function>

      a callback with the scene when import succeeds

    • Optional onProgress: Nullable<function>

      a callback with a progress event for each file being loaded

    • Optional onError: Nullable<function>

      a callback with the scene, a message, and possibly an exception when import fails

    • Optional pluginExtension: Nullable<string>

      the extension used to determine the plugin

    Returns Nullable<ISceneLoaderPlugin | ISceneLoaderPluginAsync>

    The loaded plugin

Static LoadAssetContainer

Find examples in Playground
  • Load a scene into an asset container

    Parameters

    • rootUrl: string

      a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)

    • Optional sceneFilename: string | File

      a string that defines the name of the scene file or starts with "data:" following by the stringified version of the scene or a File object (default: empty string)

    • Optional scene: Nullable<Scene>

      is the instance of BABYLON.Scene to append to (default: last created scene)

    • Optional onSuccess: Nullable<function>

      a callback with the scene when import succeeds

    • Optional onProgress: Nullable<function>

      a callback with a progress event for each file being loaded

    • Optional onError: Nullable<function>

      a callback with the scene, a message, and possibly an exception when import fails

    • Optional pluginExtension: Nullable<string>

      the extension used to determine the plugin

    Returns Nullable<ISceneLoaderPlugin | ISceneLoaderPluginAsync>

    The loaded plugin

Static LoadAssetContainerAsync

Find examples in Playground
  • Load a scene into an asset container

    Parameters

    • rootUrl: string

      a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)

    • Optional sceneFilename: string

      a string that defines the name of the scene file or starts with "data:" following by the stringified version of the scene (default: empty string)

    • Optional scene: Nullable<Scene>

      is the instance of BABYLON.Scene to append to

    • Optional onProgress: Nullable<function>

      a callback with a progress event for each file being loaded

    • Optional pluginExtension: Nullable<string>

      the extension used to determine the plugin

    Returns Promise<AssetContainer>

    The loaded asset container

Static LoadAsync

Find examples in Playground
  • Load a scene

    Parameters

    • rootUrl: string

      a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)

    • Optional sceneFilename: string | File

      a string that defines the name of the scene file or starts with "data:" following by the stringified version of the scene or a File object (default: empty string)

    • Optional engine: Nullable<Engine>

      is the instance of BABYLON.Engine to use to create the scene

    • Optional onProgress: Nullable<function>

      a callback with a progress event for each file being loaded

    • Optional pluginExtension: Nullable<string>

      the extension used to determine the plugin

    Returns Promise<Scene>

    The loaded scene

Static RegisterPlugin

Find examples in Playground

Generated using TypeDoc