Преглед изворни кода

Merge pull request #7888 from Popov72/gltf-fix-transformnode

Fix infinite loop when disposing a scene
David Catuhe пре 5 година
родитељ
комит
a5fc63e6d4
2 измењених фајлова са 3 додато и 0 уклоњено
  1. 1 0
      dist/preview release/what's new.md
  2. 2 0
      loaders/src/glTF/2.0/glTFLoader.ts

+ 1 - 0
dist/preview release/what's new.md

@@ -95,6 +95,7 @@
 - Fix bug in PBR when specific combinations of parameters are used ([Popov72](https://github.com/Popov72)
 - Fix texture being inverted on the Y axis by default when using TextureAsset or AssetManager ([broederj](https://github.com/broederj))
 - Fix `TexturePacker` cross-origin image requests, fix falsy default options ([ludevik](https://github.com/ludevik))
+- Fix freeze (infinite loop) when disposing a scene that loaded some specific gLTF files ([Popov72](https://github.com/Popov72)
 
 - Fix submesh recreation when it should not ([Popov72](https://github.com/Popov72)
 

+ 2 - 0
loaders/src/glTF/2.0/glTFLoader.ts

@@ -733,7 +733,9 @@ export class GLTFLoader implements IGLTFLoader {
             }));
         }
         else {
+            this._babylonScene._blockEntityCollection = this._forAssetContainer;
             node._babylonTransformNode = new TransformNode(name, this._babylonScene);
+            this._babylonScene._blockEntityCollection = false;
             node._primitiveBabylonMeshes = [];
             for (const primitive of primitives) {
                 promises.push(this._loadMeshPrimitiveAsync(`${context}/primitives/${primitive.index}`, `${name}_primitive${primitive.index}`, node, mesh, primitive, (babylonMesh) => {