Options
All
  • Public
  • Public/Protected
  • All
Menu

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

Constructors

Properties

DETAILED_LOGGING: 3 = 3

Detailed logging while loading

MINIMAL_LOGGING: 1 = 1

Minimal logging while loading

NO_LOGGING: 0 = 0

No logging while loading

OnPluginActivatedObservable: Observable<ISceneLoaderPlugin | ISceneLoaderPluginAsync>

Event raised when a plugin is used to load a scene

SUMMARY_LOGGING: 2 = 2

Summary logging while loading

Accessors

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

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

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

  • get loggingLevel(): number
  • set loggingLevel(value: number): void
  • 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 void

Methods

  • 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

  • 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

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

    Returns IRegisteredPlugin

    the .babylon plugin

  • 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

  • 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

  • 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

  • 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

  • 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

  • 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

  • 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

  • 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

  • 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

Legend

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

Settings

Theme