Class SceneLoader
Hierarchy
- SceneLoader
Index
Constructors
Properties
Accessors
Methods
Constructors
constructor
Returns SceneLoader
Properties
Static Readonly DETAILED_ LOGGINGSearch playground for DETAILED_LOGGING
Detailed logging while loading
Static Readonly MINIMAL_ LOGGINGSearch playground for MINIMAL_LOGGING
Minimal logging while loading
Static Readonly NO_ LOGGINGSearch playground for NO_LOGGING
No logging while loading
Static On Plugin Activated ObservableSearch playground for OnPluginActivatedObservable
Event raised when a plugin is used to load a scene
Static Readonly SUMMARY_ LOGGINGSearch playground for SUMMARY_LOGGING
Summary logging while loading
Accessors
Static Clean Bone Matrix Weights
Gets or set a boolean indicating if matrix weights must be cleaned upon loading
Returns boolean
Gets or set a boolean indicating if matrix weights must be cleaned upon loading
Parameters
value: boolean
Returns void
Static Force Full Scene Loading For Incremental
Gets or sets a boolean indicating if entire scene must be loaded even if scene contains incremental data
Returns boolean
Gets or sets a boolean indicating if entire scene must be loaded even if scene contains incremental data
Parameters
value: boolean
Returns void
Static Show Loading Screen
Gets or sets a boolean indicating if loading screen must be displayed while loading a scene
Returns boolean
Gets or sets a boolean indicating if loading screen must be displayed while loading a scene
Parameters
value: boolean
Returns void
Static logging Level
Defines the current logging level (while loading the scene)
Returns number
Defines the current logging level (while loading the scene)
Parameters
value: number
Returns void
Methods
Static AppendSearch playground for Append
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<((scene: Scene) => void)>
a callback with the scene when import succeeds
Optional onProgress: Nullable<((event: ISceneLoaderProgressEvent) => void)>
a callback with a progress event for each file being loaded
Optional onError: Nullable<((scene: Scene, message: string, exception?: any) => void)>
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 Append AsyncSearch playground for AppendAsync
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<((event: ISceneLoaderProgressEvent) => void)>
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 Get Default PluginSearch playground for GetDefaultPlugin
Gets the default plugin (used to load Babylon files)
Returns IRegisteredPlugin
the .babylon plugin
Static Get Plugin For ExtensionSearch playground for GetPluginForExtension
Gets a plugin that can load the given extension
Parameters
extension: string
defines the extension to load
Returns ISceneLoaderPluginFactory | ISceneLoaderPlugin | ISceneLoaderPluginAsync
a plugin or null if none works
Static Import AnimationsSearch playground for ImportAnimations
Import animations from a file into 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 (default: last created scene)
Optional overwriteAnimations: boolean
when true, animations are cleaned before importing new ones. Animations are appended otherwise
Optional animationGroupLoadingMode: SceneLoaderAnimationGroupLoadingMode
defines how to handle old animations groups before importing new ones
Optional targetConverter: Nullable<((target: any) => any)>
defines a function used to convert animation targets from loaded scene to current scene (default: search node by name)
Optional onSuccess: Nullable<((scene: Scene) => void)>
a callback with the scene when import succeeds
Optional onProgress: Nullable<((event: ISceneLoaderProgressEvent) => void)>
a callback with a progress event for each file being loaded
Optional onError: Nullable<((scene: Scene, message: string, exception?: any) => void)>
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 void
Static Import Animations AsyncSearch playground for ImportAnimationsAsync
Import animations from a file into 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 (default: last created scene)
Optional overwriteAnimations: boolean
when true, animations are cleaned before importing new ones. Animations are appended otherwise
Optional animationGroupLoadingMode: SceneLoaderAnimationGroupLoadingMode
defines how to handle old animations groups before importing new ones
Optional targetConverter: Nullable<((target: any) => any)>
defines a function used to convert animation targets from loaded scene to current scene (default: search node by name)
Optional onSuccess: Nullable<((scene: Scene) => void)>
a callback with the scene when import succeeds
Optional onProgress: Nullable<((event: ISceneLoaderProgressEvent) => void)>
a callback with a progress event for each file being loaded
Optional onError: Nullable<((scene: Scene, message: string, exception?: any) => void)>
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 Promise<Scene>
the updated scene with imported animations
Static Import MeshSearch playground for ImportMesh
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<SceneLoaderSuccessCallback>
a callback with a list of imported meshes, particleSystems, skeletons, and animationGroups when import succeeds
Optional onProgress: Nullable<((event: ISceneLoaderProgressEvent) => void)>
a callback with a progress event for each file being loaded
Optional onError: Nullable<((scene: Scene, message: string, exception?: any) => void)>
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 Import Mesh AsyncSearch playground for ImportMeshAsync
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<((event: ISceneLoaderProgressEvent) => void)>
a callback with a progress event for each file being loaded
Optional pluginExtension: Nullable<string>
the extension used to determine the plugin
Returns Promise<ISceneLoaderAsyncResult>
The loaded list of imported meshes, particle systems, skeletons, and animation groups
Static Is Plugin For Extension AvailableSearch playground for IsPluginForExtensionAvailable
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 LoadSearch playground for Load
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<((scene: Scene) => void)>
a callback with the scene when import succeeds
Optional onProgress: Nullable<((event: ISceneLoaderProgressEvent) => void)>
a callback with a progress event for each file being loaded
Optional onError: Nullable<((scene: Scene, message: string, exception?: any) => void)>
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 Load Asset ContainerSearch playground for LoadAssetContainer
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<((assets: AssetContainer) => void)>
a callback with the scene when import succeeds
Optional onProgress: Nullable<((event: ISceneLoaderProgressEvent) => void)>
a callback with a progress event for each file being loaded
Optional onError: Nullable<((scene: Scene, message: string, exception?: any) => void)>
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 Load Asset Container AsyncSearch playground for LoadAssetContainerAsync
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 (default: empty string)
Optional scene: Nullable<Scene>
is the instance of Scene to append to
Optional onProgress: Nullable<((event: ISceneLoaderProgressEvent) => void)>
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 Load AsyncSearch playground for LoadAsync
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<((event: ISceneLoaderProgressEvent) => void)>
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 Register PluginSearch playground for RegisterPlugin
Adds a new plugin to the list of registered plugins
Parameters
plugin: ISceneLoaderPlugin | ISceneLoaderPluginAsync
defines the plugin to add
Returns void
Class used to load scene from various file formats using registered plugins
https://doc.babylonjs.com/features/featuresDeepDive/importers/loadingFileTypes