|
@@ -273,6 +273,10 @@ export class GLTFLoader implements IGLTFLoader {
|
|
|
|
|
|
const promises = new Array<Promise<any>>();
|
|
|
|
|
|
+ // Block the marking of materials dirty until the scene is loaded.
|
|
|
+ const oldBlockMaterialDirtyMechanism = this._babylonScene.blockMaterialDirtyMechanism;
|
|
|
+ this._babylonScene.blockMaterialDirtyMechanism = true;
|
|
|
+
|
|
|
if (nodes) {
|
|
|
promises.push(this.loadSceneAsync("/nodes", { nodes: nodes, index: -1 }));
|
|
|
}
|
|
@@ -281,6 +285,9 @@ export class GLTFLoader implements IGLTFLoader {
|
|
|
promises.push(this.loadSceneAsync(`/scenes/${scene.index}`, scene));
|
|
|
}
|
|
|
|
|
|
+ // Restore the blocking of material dirty.
|
|
|
+ this._babylonScene.blockMaterialDirtyMechanism = oldBlockMaterialDirtyMechanism;
|
|
|
+
|
|
|
if (this._parent.compileMaterials) {
|
|
|
promises.push(this._compileMaterialsAsync());
|
|
|
}
|