소스 검색

Load nothing instead of error if scene is undefined

Gary Hsu 6 년 전
부모
커밋
40e0db6878
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      loaders/src/glTF/2.0/glTFLoader.ts

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

@@ -257,8 +257,8 @@ export class GLTFLoader implements IGLTFLoader {
             if (nodes) {
                 promises.push(this.loadSceneAsync("/nodes", { nodes: nodes, index: -1 }));
             }
-            else {
-                const scene = ArrayItem.Get(`/scene`, this.gltf.scenes, this.gltf.scene || 0);
+            else if (this.gltf.scene != undefined) {
+                const scene = ArrayItem.Get(`/scene`, this.gltf.scenes, this.gltf.scene);
                 promises.push(this.loadSceneAsync(`/scenes/${scene.index}`, scene));
             }