Gary Hsu пре 7 година
родитељ
комит
c636f2b726
2 измењених фајлова са 3 додато и 3 уклоњено
  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;
         }
     });