فهرست منبع

Merge pull request #5998 from bghgary/default-scene-fix

Fix for default scene loading in glTF loader
David Catuhe 6 سال پیش
والد
کامیت
eec1206493
1فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 2 2
      loaders/src/glTF/2.0/glTFLoader.ts

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

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