Selaa lähdekoodia

Fix glTF loader bug

Gary Hsu 7 vuotta sitten
vanhempi
commit
c636f2b726
2 muutettua tiedostoa jossa 3 lisäystä ja 3 poistoa
  1. 2 2
      loaders/src/glTF/2.0/babylon.glTFLoader.ts
  2. 1 1
      sandbox/index.js

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

@@ -1766,7 +1766,7 @@ module BABYLON.GLTF2 {
                         }
                     }
                 }
-                else {
+                else if (mesh.material) {
                     remaining++;
                 }
             }
@@ -1788,7 +1788,7 @@ module BABYLON.GLTF2 {
                         }
                     }
                 }
-                else if (mesh.material !== null) {
+                else if (mesh.material) {
                     this._compileMaterialAsync(mesh.material, mesh, () => {
                         if (--remaining === 0) {
                             onSuccess();

+ 1 - 1
sandbox/index.js

@@ -39,7 +39,7 @@ if (BABYLON.Engine.isSupported()) {
 
         if (plugin.name === "gltf" && plugin instanceof BABYLON.GLTFFileLoader) {
             plugin.animationStartMode = BABYLON.GLTFLoaderAnimationStartMode.ALL;
-            //  plugin.compileMaterials = true;
+            plugin.compileMaterials = true;
         }
     });