sceneLoader.d.ts 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462
  1. import { Observable } from "../Misc/observable";
  2. import type { Nullable } from "../types";
  3. import { Scene } from "../scene";
  4. import type { AbstractMesh } from "../Meshes/abstractMesh";
  5. import type { AnimationGroup } from "../Animations/animationGroup";
  6. import type { AssetContainer } from "../assetContainer";
  7. import type { IParticleSystem } from "../Particles/IParticleSystem";
  8. import type { Skeleton } from "../Bones/skeleton";
  9. import type { IFileRequest } from "../Misc/fileRequest";
  10. import type { WebRequest } from "../Misc/webRequest";
  11. import type { LoadFileError } from "../Misc/fileTools";
  12. import type { TransformNode } from "../Meshes/transformNode";
  13. import type { Geometry } from "../Meshes/geometry";
  14. import type { Light } from "../Lights/light";
  15. import type { ISpriteManager } from "../Sprites/spriteManager";
  16. import type { AbstractEngine } from "../Engines/abstractEngine";
  17. /**
  18. * Type used for the success callback of ImportMesh
  19. */
  20. export type SceneLoaderSuccessCallback = (meshes: AbstractMesh[], particleSystems: IParticleSystem[], skeletons: Skeleton[], animationGroups: AnimationGroup[], transformNodes: TransformNode[], geometries: Geometry[], lights: Light[], spriteManagers: ISpriteManager[]) => void;
  21. /**
  22. * Interface used for the result of ImportMeshAsync
  23. */
  24. export interface ISceneLoaderAsyncResult {
  25. /**
  26. * The array of loaded meshes
  27. */
  28. readonly meshes: AbstractMesh[];
  29. /**
  30. * The array of loaded particle systems
  31. */
  32. readonly particleSystems: IParticleSystem[];
  33. /**
  34. * The array of loaded skeletons
  35. */
  36. readonly skeletons: Skeleton[];
  37. /**
  38. * The array of loaded animation groups
  39. */
  40. readonly animationGroups: AnimationGroup[];
  41. /**
  42. * The array of loaded transform nodes
  43. */
  44. readonly transformNodes: TransformNode[];
  45. /**
  46. * The array of loaded geometries
  47. */
  48. readonly geometries: Geometry[];
  49. /**
  50. * The array of loaded lights
  51. */
  52. readonly lights: Light[];
  53. /**
  54. * The array of loaded sprite managers
  55. */
  56. readonly spriteManagers: ISpriteManager[];
  57. }
  58. /**
  59. * Interface used to represent data loading progression
  60. */
  61. export interface ISceneLoaderProgressEvent {
  62. /**
  63. * Defines if data length to load can be evaluated
  64. */
  65. readonly lengthComputable: boolean;
  66. /**
  67. * Defines the loaded data length
  68. */
  69. readonly loaded: number;
  70. /**
  71. * Defines the data length to load
  72. */
  73. readonly total: number;
  74. }
  75. /**
  76. * Interface used by SceneLoader plugins to define supported file extensions
  77. */
  78. export interface ISceneLoaderPluginExtensions {
  79. /**
  80. * Defines the list of supported extensions
  81. */
  82. [extension: string]: {
  83. isBinary: boolean;
  84. };
  85. }
  86. /**
  87. * Interface used by SceneLoader plugin factory
  88. */
  89. export interface ISceneLoaderPluginFactory {
  90. /**
  91. * Defines the name of the factory
  92. */
  93. name: string;
  94. /**
  95. * Function called to create a new plugin
  96. * @returns the new plugin
  97. */
  98. createPlugin(): ISceneLoaderPlugin | ISceneLoaderPluginAsync;
  99. /**
  100. * The callback that returns true if the data can be directly loaded.
  101. * @param data string containing the file data
  102. * @returns if the data can be loaded directly
  103. */
  104. canDirectLoad?(data: string): boolean;
  105. }
  106. /**
  107. * Interface used to define the base of ISceneLoaderPlugin and ISceneLoaderPluginAsync
  108. */
  109. export interface ISceneLoaderPluginBase {
  110. /**
  111. * The friendly name of this plugin.
  112. */
  113. name: string;
  114. /**
  115. * The file extensions supported by this plugin.
  116. */
  117. extensions: string | ISceneLoaderPluginExtensions;
  118. /**
  119. * The callback called when loading from a url.
  120. * @param scene scene loading this url
  121. * @param fileOrUrl file or url to load
  122. * @param rootUrl root url to use to load assets
  123. * @param onSuccess callback called when the file successfully loads
  124. * @param onProgress callback called while file is loading (if the server supports this mode)
  125. * @param useArrayBuffer defines a boolean indicating that date must be returned as ArrayBuffer
  126. * @param onError callback called when the file fails to load
  127. * @param name defines the name of the file when loading a binary file
  128. * @returns a file request object
  129. */
  130. loadFile?(scene: Scene, fileOrUrl: File | string | ArrayBufferView, rootUrl: string, onSuccess: (data: any, responseURL?: string) => void, onProgress?: (ev: ISceneLoaderProgressEvent) => void, useArrayBuffer?: boolean, onError?: (request?: WebRequest, exception?: LoadFileError) => void, name?: string): Nullable<IFileRequest>;
  131. /**
  132. * The callback that returns true if the data can be directly loaded.
  133. * @param data string containing the file data
  134. * @returns if the data can be loaded directly
  135. */
  136. canDirectLoad?(data: string): boolean;
  137. /**
  138. * The callback that returns the data to pass to the plugin if the data can be directly loaded.
  139. * @param scene scene loading this data
  140. * @param data string containing the data
  141. * @returns data to pass to the plugin
  142. */
  143. directLoad?(scene: Scene, data: string): any;
  144. /**
  145. * The callback that allows custom handling of the root url based on the response url.
  146. * @param rootUrl the original root url
  147. * @param responseURL the response url if available
  148. * @returns the new root url
  149. */
  150. rewriteRootURL?(rootUrl: string, responseURL?: string): string;
  151. }
  152. /**
  153. * Interface used to define a SceneLoader plugin
  154. */
  155. export interface ISceneLoaderPlugin extends ISceneLoaderPluginBase {
  156. /**
  157. * Import meshes into a scene.
  158. * @param meshesNames An array of mesh names, a single mesh name, or empty string for all meshes that filter what meshes are imported
  159. * @param scene The scene to import into
  160. * @param data The data to import
  161. * @param rootUrl The root url for scene and resources
  162. * @param meshes The meshes array to import into
  163. * @param particleSystems The particle systems array to import into
  164. * @param skeletons The skeletons array to import into
  165. * @param onError The callback when import fails
  166. * @returns True if successful or false otherwise
  167. */
  168. importMesh(meshesNames: any, scene: Scene, data: any, rootUrl: string, meshes: AbstractMesh[], particleSystems: IParticleSystem[], skeletons: Skeleton[], onError?: (message: string, exception?: any) => void): boolean;
  169. /**
  170. * Load into a scene.
  171. * @param scene The scene to load into
  172. * @param data The data to import
  173. * @param rootUrl The root url for scene and resources
  174. * @param onError The callback when import fails
  175. * @returns True if successful or false otherwise
  176. */
  177. load(scene: Scene, data: any, rootUrl: string, onError?: (message: string, exception?: any) => void): boolean;
  178. /**
  179. * Load into an asset container.
  180. * @param scene The scene to load into
  181. * @param data The data to import
  182. * @param rootUrl The root url for scene and resources
  183. * @param onError The callback when import fails
  184. * @returns The loaded asset container
  185. */
  186. loadAssetContainer(scene: Scene, data: any, rootUrl: string, onError?: (message: string, exception?: any) => void): AssetContainer;
  187. }
  188. /**
  189. * Interface used to define an async SceneLoader plugin
  190. */
  191. export interface ISceneLoaderPluginAsync extends ISceneLoaderPluginBase {
  192. /**
  193. * Import meshes into a scene.
  194. * @param meshesNames An array of mesh names, a single mesh name, or empty string for all meshes that filter what meshes are imported
  195. * @param scene The scene to import into
  196. * @param data The data to import
  197. * @param rootUrl The root url for scene and resources
  198. * @param onProgress The callback when the load progresses
  199. * @param fileName Defines the name of the file to load
  200. * @returns The loaded objects (e.g. meshes, particle systems, skeletons, animation groups, etc.)
  201. */
  202. importMeshAsync(meshesNames: any, scene: Scene, data: any, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string): Promise<ISceneLoaderAsyncResult>;
  203. /**
  204. * Load into a scene.
  205. * @param scene The scene to load into
  206. * @param data The data to import
  207. * @param rootUrl The root url for scene and resources
  208. * @param onProgress The callback when the load progresses
  209. * @param fileName Defines the name of the file to load
  210. * @returns Nothing
  211. */
  212. loadAsync(scene: Scene, data: any, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string): Promise<void>;
  213. /**
  214. * Load into an asset container.
  215. * @param scene The scene to load into
  216. * @param data The data to import
  217. * @param rootUrl The root url for scene and resources
  218. * @param onProgress The callback when the load progresses
  219. * @param fileName Defines the name of the file to load
  220. * @returns The loaded asset container
  221. */
  222. loadAssetContainerAsync(scene: Scene, data: any, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string): Promise<AssetContainer>;
  223. }
  224. /**
  225. * Mode that determines how to handle old animation groups before loading new ones.
  226. */
  227. export declare enum SceneLoaderAnimationGroupLoadingMode {
  228. /**
  229. * Reset all old animations to initial state then dispose them.
  230. */
  231. Clean = 0,
  232. /**
  233. * Stop all old animations.
  234. */
  235. Stop = 1,
  236. /**
  237. * Restart old animations from first frame.
  238. */
  239. Sync = 2,
  240. /**
  241. * Old animations remains untouched.
  242. */
  243. NoSync = 3
  244. }
  245. /**
  246. * Defines a plugin registered by the SceneLoader
  247. */
  248. interface IRegisteredPlugin {
  249. /**
  250. * Defines the plugin to use
  251. */
  252. plugin: ISceneLoaderPlugin | ISceneLoaderPluginAsync | ISceneLoaderPluginFactory;
  253. /**
  254. * Defines if the plugin supports binary data
  255. */
  256. isBinary: boolean;
  257. }
  258. /**
  259. * Class used to load scene from various file formats using registered plugins
  260. * @see https://doc.babylonjs.com/features/featuresDeepDive/importers/loadingFileTypes
  261. */
  262. export declare class SceneLoader {
  263. /**
  264. * No logging while loading
  265. */
  266. static readonly NO_LOGGING = 0;
  267. /**
  268. * Minimal logging while loading
  269. */
  270. static readonly MINIMAL_LOGGING = 1;
  271. /**
  272. * Summary logging while loading
  273. */
  274. static readonly SUMMARY_LOGGING = 2;
  275. /**
  276. * Detailed logging while loading
  277. */
  278. static readonly DETAILED_LOGGING = 3;
  279. /**
  280. * Gets or sets a boolean indicating if entire scene must be loaded even if scene contains incremental data
  281. */
  282. static get ForceFullSceneLoadingForIncremental(): boolean;
  283. static set ForceFullSceneLoadingForIncremental(value: boolean);
  284. /**
  285. * Gets or sets a boolean indicating if loading screen must be displayed while loading a scene
  286. */
  287. static get ShowLoadingScreen(): boolean;
  288. static set ShowLoadingScreen(value: boolean);
  289. /**
  290. * Defines the current logging level (while loading the scene)
  291. * @ignorenaming
  292. */
  293. static get loggingLevel(): number;
  294. static set loggingLevel(value: number);
  295. /**
  296. * Gets or set a boolean indicating if matrix weights must be cleaned upon loading
  297. */
  298. static get CleanBoneMatrixWeights(): boolean;
  299. static set CleanBoneMatrixWeights(value: boolean);
  300. /**
  301. * Event raised when a plugin is used to load a scene
  302. */
  303. static OnPluginActivatedObservable: Observable<ISceneLoaderPlugin | ISceneLoaderPluginAsync>;
  304. private static _RegisteredPlugins;
  305. private static _ShowingLoadingScreen;
  306. /**
  307. * Gets the default plugin (used to load Babylon files)
  308. * @returns the .babylon plugin
  309. */
  310. static GetDefaultPlugin(): IRegisteredPlugin;
  311. private static _GetPluginForExtension;
  312. private static _GetPluginForDirectLoad;
  313. private static _GetPluginForFilename;
  314. private static _GetDirectLoad;
  315. private static _FormatErrorMessage;
  316. private static _LoadData;
  317. private static _GetFileInfo;
  318. /**
  319. * Gets a plugin that can load the given extension
  320. * @param extension defines the extension to load
  321. * @returns a plugin or null if none works
  322. */
  323. static GetPluginForExtension(extension: string): ISceneLoaderPlugin | ISceneLoaderPluginAsync | ISceneLoaderPluginFactory;
  324. /**
  325. * Gets a boolean indicating that the given extension can be loaded
  326. * @param extension defines the extension to load
  327. * @returns true if the extension is supported
  328. */
  329. static IsPluginForExtensionAvailable(extension: string): boolean;
  330. /**
  331. * Adds a new plugin to the list of registered plugins
  332. * @param plugin defines the plugin to add
  333. */
  334. static RegisterPlugin(plugin: ISceneLoaderPlugin | ISceneLoaderPluginAsync): void;
  335. /**
  336. * Import meshes into a scene
  337. * @param meshNames an array of mesh names, a single mesh name, or empty string for all meshes that filter what meshes are imported
  338. * @param rootUrl 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)
  339. * @param sceneFilename 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)
  340. * @param scene the instance of BABYLON.Scene to append to
  341. * @param onSuccess a callback with a list of imported meshes, particleSystems, skeletons, and animationGroups when import succeeds
  342. * @param onProgress a callback with a progress event for each file being loaded
  343. * @param onError a callback with the scene, a message, and possibly an exception when import fails
  344. * @param pluginExtension the extension used to determine the plugin
  345. * @param name defines the name of the file, if the data is binary
  346. * @returns The loaded plugin
  347. */
  348. static ImportMesh(meshNames: any, rootUrl: string, sceneFilename?: string | File | ArrayBufferView, scene?: Nullable<Scene>, onSuccess?: Nullable<SceneLoaderSuccessCallback>, onProgress?: Nullable<(event: ISceneLoaderProgressEvent) => void>, onError?: Nullable<(scene: Scene, message: string, exception?: any) => void>, pluginExtension?: Nullable<string>, name?: string): Nullable<ISceneLoaderPlugin | ISceneLoaderPluginAsync>;
  349. /**
  350. * Import meshes into a scene
  351. * @param meshNames an array of mesh names, a single mesh name, or empty string for all meshes that filter what meshes are imported
  352. * @param rootUrl 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)
  353. * @param sceneFilename 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)
  354. * @param scene the instance of BABYLON.Scene to append to
  355. * @param onProgress a callback with a progress event for each file being loaded
  356. * @param pluginExtension the extension used to determine the plugin
  357. * @param name defines the name of the file
  358. * @returns The loaded list of imported meshes, particle systems, skeletons, and animation groups
  359. */
  360. static ImportMeshAsync(meshNames: any, rootUrl: string, sceneFilename?: string | File | ArrayBufferView, scene?: Nullable<Scene>, onProgress?: Nullable<(event: ISceneLoaderProgressEvent) => void>, pluginExtension?: Nullable<string>, name?: string): Promise<ISceneLoaderAsyncResult>;
  361. /**
  362. * Load a scene
  363. * @param rootUrl 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)
  364. * @param sceneFilename 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)
  365. * @param engine is the instance of BABYLON.Engine to use to create the scene
  366. * @param onSuccess a callback with the scene when import succeeds
  367. * @param onProgress a callback with a progress event for each file being loaded
  368. * @param onError a callback with the scene, a message, and possibly an exception when import fails
  369. * @param pluginExtension the extension used to determine the plugin
  370. * @param name defines the filename, if the data is binary
  371. * @returns The loaded plugin
  372. */
  373. static Load(rootUrl: string, sceneFilename?: string | File | ArrayBufferView, engine?: Nullable<AbstractEngine>, onSuccess?: Nullable<(scene: Scene) => void>, onProgress?: Nullable<(event: ISceneLoaderProgressEvent) => void>, onError?: Nullable<(scene: Scene, message: string, exception?: any) => void>, pluginExtension?: Nullable<string>, name?: string): Nullable<ISceneLoaderPlugin | ISceneLoaderPluginAsync>;
  374. /**
  375. * Load a scene
  376. * @param rootUrl 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)
  377. * @param sceneFilename 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)
  378. * @param engine is the instance of BABYLON.Engine to use to create the scene
  379. * @param onProgress a callback with a progress event for each file being loaded
  380. * @param pluginExtension the extension used to determine the plugin
  381. * @param name defines the filename, if the data is binary
  382. * @returns The loaded scene
  383. */
  384. static LoadAsync(rootUrl: string, sceneFilename?: string | File | ArrayBufferView, engine?: Nullable<AbstractEngine>, onProgress?: Nullable<(event: ISceneLoaderProgressEvent) => void>, pluginExtension?: Nullable<string>, name?: string): Promise<Scene>;
  385. /**
  386. * Append a scene
  387. * @param rootUrl 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)
  388. * @param sceneFilename 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)
  389. * @param scene is the instance of BABYLON.Scene to append to
  390. * @param onSuccess a callback with the scene when import succeeds
  391. * @param onProgress a callback with a progress event for each file being loaded
  392. * @param onError a callback with the scene, a message, and possibly an exception when import fails
  393. * @param pluginExtension the extension used to determine the plugin
  394. * @param name defines the name of the file, if the data is binary
  395. * @returns The loaded plugin
  396. */
  397. static Append(rootUrl: string, sceneFilename?: string | File | ArrayBufferView, scene?: Nullable<Scene>, onSuccess?: Nullable<(scene: Scene) => void>, onProgress?: Nullable<(event: ISceneLoaderProgressEvent) => void>, onError?: Nullable<(scene: Scene, message: string, exception?: any) => void>, pluginExtension?: Nullable<string>, name?: string): Nullable<ISceneLoaderPlugin | ISceneLoaderPluginAsync>;
  398. /**
  399. * Append a scene
  400. * @param rootUrl 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)
  401. * @param sceneFilename 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)
  402. * @param scene is the instance of BABYLON.Scene to append to
  403. * @param onProgress a callback with a progress event for each file being loaded
  404. * @param pluginExtension the extension used to determine the plugin
  405. * @param name defines the name of the file, if the data is binary
  406. * @returns The given scene
  407. */
  408. static AppendAsync(rootUrl: string, sceneFilename?: string | File | ArrayBufferView, scene?: Nullable<Scene>, onProgress?: Nullable<(event: ISceneLoaderProgressEvent) => void>, pluginExtension?: Nullable<string>, name?: string): Promise<Scene>;
  409. /**
  410. * Load a scene into an asset container
  411. * @param rootUrl 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)
  412. * @param sceneFilename 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)
  413. * @param scene is the instance of BABYLON.Scene to append to (default: last created scene)
  414. * @param onSuccess a callback with the scene when import succeeds
  415. * @param onProgress a callback with a progress event for each file being loaded
  416. * @param onError a callback with the scene, a message, and possibly an exception when import fails
  417. * @param pluginExtension the extension used to determine the plugin
  418. * @param name defines the filename, if the data is binary
  419. * @returns The loaded plugin
  420. */
  421. static LoadAssetContainer(rootUrl: string, sceneFilename?: string | File | ArrayBufferView, scene?: Nullable<Scene>, onSuccess?: Nullable<(assets: AssetContainer) => void>, onProgress?: Nullable<(event: ISceneLoaderProgressEvent) => void>, onError?: Nullable<(scene: Scene, message: string, exception?: any) => void>, pluginExtension?: Nullable<string>, name?: string): Nullable<ISceneLoaderPlugin | ISceneLoaderPluginAsync>;
  422. /**
  423. * Load a scene into an asset container
  424. * @param rootUrl 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)
  425. * @param sceneFilename 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)
  426. * @param scene is the instance of Scene to append to
  427. * @param onProgress a callback with a progress event for each file being loaded
  428. * @param pluginExtension the extension used to determine the plugin
  429. * @returns The loaded asset container
  430. */
  431. static LoadAssetContainerAsync(rootUrl: string, sceneFilename?: string | File, scene?: Nullable<Scene>, onProgress?: Nullable<(event: ISceneLoaderProgressEvent) => void>, pluginExtension?: Nullable<string>): Promise<AssetContainer>;
  432. /**
  433. * Import animations from a file into a scene
  434. * @param rootUrl 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)
  435. * @param sceneFilename 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)
  436. * @param scene is the instance of BABYLON.Scene to append to (default: last created scene)
  437. * @param overwriteAnimations when true, animations are cleaned before importing new ones. Animations are appended otherwise
  438. * @param animationGroupLoadingMode defines how to handle old animations groups before importing new ones
  439. * @param targetConverter defines a function used to convert animation targets from loaded scene to current scene (default: search node by name)
  440. * @param onSuccess a callback with the scene when import succeeds
  441. * @param onProgress a callback with a progress event for each file being loaded
  442. * @param onError a callback with the scene, a message, and possibly an exception when import fails
  443. * @param pluginExtension the extension used to determine the plugin
  444. */
  445. static ImportAnimations(rootUrl: string, sceneFilename?: string | File, scene?: Nullable<Scene>, overwriteAnimations?: boolean, animationGroupLoadingMode?: SceneLoaderAnimationGroupLoadingMode, targetConverter?: Nullable<(target: any) => any>, onSuccess?: Nullable<(scene: Scene) => void>, onProgress?: Nullable<(event: ISceneLoaderProgressEvent) => void>, onError?: Nullable<(scene: Scene, message: string, exception?: any) => void>, pluginExtension?: Nullable<string>): void;
  446. /**
  447. * Import animations from a file into a scene
  448. * @param rootUrl 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)
  449. * @param sceneFilename 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)
  450. * @param scene is the instance of BABYLON.Scene to append to (default: last created scene)
  451. * @param overwriteAnimations when true, animations are cleaned before importing new ones. Animations are appended otherwise
  452. * @param animationGroupLoadingMode defines how to handle old animations groups before importing new ones
  453. * @param targetConverter defines a function used to convert animation targets from loaded scene to current scene (default: search node by name)
  454. * @param onSuccess a callback with the scene when import succeeds
  455. * @param onProgress a callback with a progress event for each file being loaded
  456. * @param onError a callback with the scene, a message, and possibly an exception when import fails
  457. * @param pluginExtension the extension used to determine the plugin
  458. * @returns the updated scene with imported animations
  459. */
  460. static ImportAnimationsAsync(rootUrl: string, sceneFilename?: string | File, scene?: Nullable<Scene>, overwriteAnimations?: boolean, animationGroupLoadingMode?: SceneLoaderAnimationGroupLoadingMode, targetConverter?: Nullable<(target: any) => any>, onSuccess?: Nullable<(scene: Scene) => void>, onProgress?: Nullable<(event: ISceneLoaderProgressEvent) => void>, onError?: Nullable<(scene: Scene, message: string, exception?: any) => void>, pluginExtension?: Nullable<string>): Promise<Scene>;
  461. }
  462. export {};