|
@@ -32535,6 +32535,7 @@ var BABYLON;
|
|
|
if (buffer === void 0) { buffer = null; }
|
|
|
if (this.url) {
|
|
|
this.releaseInternalTexture();
|
|
|
+ this.getScene().markAllMaterialsAsDirty(BABYLON.Material.TextureDirtyFlag);
|
|
|
}
|
|
|
this.url = url;
|
|
|
this._buffer = buffer;
|
|
@@ -73810,6 +73811,7 @@ var BABYLON;
|
|
|
CubeTexture.prototype.updateURL = function (url, forcedExtension, onLoad) {
|
|
|
if (this.url) {
|
|
|
this.releaseInternalTexture();
|
|
|
+ this.getScene().markAllMaterialsAsDirty(BABYLON.Material.TextureDirtyFlag);
|
|
|
}
|
|
|
this.url = url;
|
|
|
this.delayLoadState = BABYLON.Engine.DELAYLOADSTATE_NOTLOADED;
|
|
@@ -78716,7 +78718,7 @@ var BABYLON;
|
|
|
dataCallback(directLoad);
|
|
|
return plugin;
|
|
|
}
|
|
|
- var file = BABYLON.FilesInput.FilesToLoad[fileInfo.name.toLowerCase()];
|
|
|
+ var file = fileInfo.file || BABYLON.FilesInput.FilesToLoad[fileInfo.name.toLowerCase()];
|
|
|
if (fileInfo.rootUrl.indexOf("file:") === -1 || (fileInfo.rootUrl.indexOf("file:") !== -1 && !file)) {
|
|
|
var engine = scene.getEngine();
|
|
|
var canUseOfflineSupport = engine.enableOfflineSupport;
|
|
@@ -78754,11 +78756,17 @@ var BABYLON;
|
|
|
SceneLoader._getFileInfo = function (rootUrl, sceneFilename) {
|
|
|
var url;
|
|
|
var name;
|
|
|
+ var file = null;
|
|
|
if (!sceneFilename) {
|
|
|
url = rootUrl;
|
|
|
name = BABYLON.Tools.GetFilename(rootUrl);
|
|
|
rootUrl = BABYLON.Tools.GetFolderPath(rootUrl);
|
|
|
}
|
|
|
+ else if (sceneFilename instanceof File) {
|
|
|
+ url = rootUrl + sceneFilename.name;
|
|
|
+ name = sceneFilename.name;
|
|
|
+ file = sceneFilename;
|
|
|
+ }
|
|
|
else {
|
|
|
if (sceneFilename.substr(0, 1) === "/") {
|
|
|
BABYLON.Tools.Error("Wrong sceneFilename parameter");
|
|
@@ -78770,7 +78778,8 @@ var BABYLON;
|
|
|
return {
|
|
|
url: url,
|
|
|
rootUrl: rootUrl,
|
|
|
- name: name
|
|
|
+ name: name,
|
|
|
+ file: file
|
|
|
};
|
|
|
};
|
|
|
// Public functions
|
|
@@ -78816,7 +78825,7 @@ var BABYLON;
|
|
|
* Import meshes into a scene
|
|
|
* @param meshNames an array of mesh names, a single mesh name, or empty string for all meshes that filter what meshes are imported
|
|
|
* @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)
|
|
|
- * @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)
|
|
|
+ * @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)
|
|
|
* @param scene the instance of BABYLON.Scene to append to
|
|
|
* @param onSuccess a callback with a list of imported meshes, particleSystems, and skeletons when import succeeds
|
|
|
* @param onProgress a callback with a progress event for each file being loaded
|
|
@@ -78905,7 +78914,7 @@ var BABYLON;
|
|
|
* Import meshes into a scene
|
|
|
* @param meshNames an array of mesh names, a single mesh name, or empty string for all meshes that filter what meshes are imported
|
|
|
* @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)
|
|
|
- * @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)
|
|
|
+ * @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)
|
|
|
* @param scene the instance of BABYLON.Scene to append to
|
|
|
* @param onProgress a callback with a progress event for each file being loaded
|
|
|
* @param pluginExtension the extension used to determine the plugin
|
|
@@ -78932,7 +78941,7 @@ var BABYLON;
|
|
|
/**
|
|
|
* Load a scene
|
|
|
* @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)
|
|
|
- * @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)
|
|
|
+ * @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)
|
|
|
* @param engine is the instance of BABYLON.Engine to use to create the scene
|
|
|
* @param onSuccess a callback with the scene when import succeeds
|
|
|
* @param onProgress a callback with a progress event for each file being loaded
|
|
@@ -78941,22 +78950,30 @@ var BABYLON;
|
|
|
* @returns The loaded plugin
|
|
|
*/
|
|
|
SceneLoader.Load = function (rootUrl, sceneFilename, engine, onSuccess, onProgress, onError, pluginExtension) {
|
|
|
+ if (sceneFilename === void 0) { sceneFilename = ""; }
|
|
|
+ if (engine === void 0) { engine = BABYLON.Engine.LastCreatedEngine; }
|
|
|
if (onSuccess === void 0) { onSuccess = null; }
|
|
|
if (onProgress === void 0) { onProgress = null; }
|
|
|
if (onError === void 0) { onError = null; }
|
|
|
if (pluginExtension === void 0) { pluginExtension = null; }
|
|
|
+ if (!engine) {
|
|
|
+ BABYLON.Tools.Error("No engine available");
|
|
|
+ return null;
|
|
|
+ }
|
|
|
return SceneLoader.Append(rootUrl, sceneFilename, new BABYLON.Scene(engine), onSuccess, onProgress, onError, pluginExtension);
|
|
|
};
|
|
|
/**
|
|
|
* Load a scene
|
|
|
* @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)
|
|
|
- * @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)
|
|
|
+ * @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)
|
|
|
* @param engine is the instance of BABYLON.Engine to use to create the scene
|
|
|
* @param onProgress a callback with a progress event for each file being loaded
|
|
|
* @param pluginExtension the extension used to determine the plugin
|
|
|
* @returns The loaded scene
|
|
|
*/
|
|
|
SceneLoader.LoadAsync = function (rootUrl, sceneFilename, engine, onProgress, pluginExtension) {
|
|
|
+ if (sceneFilename === void 0) { sceneFilename = ""; }
|
|
|
+ if (engine === void 0) { engine = BABYLON.Engine.LastCreatedEngine; }
|
|
|
if (onProgress === void 0) { onProgress = null; }
|
|
|
if (pluginExtension === void 0) { pluginExtension = null; }
|
|
|
return new Promise(function (resolve, reject) {
|
|
@@ -78970,7 +78987,7 @@ var BABYLON;
|
|
|
/**
|
|
|
* Append a scene
|
|
|
* @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)
|
|
|
- * @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)
|
|
|
+ * @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)
|
|
|
* @param scene is the instance of BABYLON.Scene to append to
|
|
|
* @param onSuccess a callback with the scene when import succeeds
|
|
|
* @param onProgress a callback with a progress event for each file being loaded
|
|
@@ -79060,7 +79077,7 @@ var BABYLON;
|
|
|
/**
|
|
|
* Append a scene
|
|
|
* @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)
|
|
|
- * @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)
|
|
|
+ * @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)
|
|
|
* @param scene is the instance of BABYLON.Scene to append to
|
|
|
* @param onProgress a callback with a progress event for each file being loaded
|
|
|
* @param pluginExtension the extension used to determine the plugin
|
|
@@ -79082,7 +79099,7 @@ var BABYLON;
|
|
|
/**
|
|
|
* Load a scene into an asset container
|
|
|
* @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)
|
|
|
- * @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)
|
|
|
+ * @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)
|
|
|
* @param scene is the instance of BABYLON.Scene to append to (default: last created scene)
|
|
|
* @param onSuccess a callback with the scene when import succeeds
|
|
|
* @param onProgress a callback with a progress event for each file being loaded
|
|
@@ -80092,7 +80109,7 @@ var BABYLON;
|
|
|
}
|
|
|
this._engine.stopRenderLoop();
|
|
|
}
|
|
|
- BABYLON.SceneLoader.LoadAsync("file:", this._sceneFileToLoad.name, this._engine, function (progress) {
|
|
|
+ BABYLON.SceneLoader.LoadAsync("file:", this._sceneFileToLoad, this._engine, function (progress) {
|
|
|
if (_this._progressCallback) {
|
|
|
_this._progressCallback(progress);
|
|
|
}
|