Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SceneLoader

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

see

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

Hierarchy

  • SceneLoader

Index

Properties

Static Readonly DETAILED_LOGGINGSearch playground for DETAILED_LOGGING

DETAILED_LOGGING: number

Detailled logging while loading

Static Readonly MINIMAL_LOGGINGSearch playground for MINIMAL_LOGGING

MINIMAL_LOGGING: number

Minimal logging while loading

Static Readonly NO_LOGGINGSearch playground for NO_LOGGING

NO_LOGGING: number

No logging while loading

Static OnPluginActivatedObservableSearch playground for OnPluginActivatedObservable

OnPluginActivatedObservable: Observable<ISceneLoaderPlugin | ISceneLoaderPluginAsync>

Event raised when a plugin is used to load a scene

Static Readonly SUMMARY_LOGGINGSearch playground for SUMMARY_LOGGING

SUMMARY_LOGGING: number

Summary logging while loading

Accessors

Static CleanBoneMatrixWeights

  • get CleanBoneMatrixWeights(): boolean
  • set CleanBoneMatrixWeights(value: boolean): any
  • 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 any

Static ForceFullSceneLoadingForIncremental

  • get ForceFullSceneLoadingForIncremental(): boolean
  • set ForceFullSceneLoadingForIncremental(value: boolean): any
  • 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 any

Static ShowLoadingScreen

  • get ShowLoadingScreen(): boolean
  • set ShowLoadingScreen(value: boolean): any
  • 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 any

Static loggingLevel

  • get loggingLevel(): number
  • set loggingLevel(value: number): any
  • Defines the current logging level (while loading the scene)

    ignorenaming

    Returns number

  • Defines the current logging level (while loading the scene)

    ignorenaming

    Parameters

    • value: number

    Returns any

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 AppendAsyncSearch 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 GetDefaultPluginSearch playground for GetDefaultPlugin

  • Gets the default plugin (used to load Babylon files)

    Returns IRegisteredPlugin

    the .babylon plugin

Static GetPluginForExtensionSearch playground for GetPluginForExtension

Static ImportAnimationsSearch 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 ImportAnimationsAsyncSearch 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 ImportMeshSearch 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 ImportMeshAsyncSearch 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 IsPluginForExtensionAvailableSearch playground for IsPluginForExtensionAvailable

  • 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 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 LoadAssetContainerSearch 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 LoadAssetContainerAsyncSearch 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

      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 LoadAsyncSearch 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 RegisterPluginSearch playground for RegisterPlugin

Legend

  • Constructor
  • Property
  • Method
  • Property
  • Method
  • Inherited property
  • Inherited method
  • Static property
  • Static method