Explorar o código

Use default material if materials is not defined in JSON (for 1.1)

Takahiro %!s(int64=8) %!d(string=hai) anos
pai
achega
77c5b1ff49
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      examples/js/loaders/GLTFLoader.js

+ 1 - 1
examples/js/loaders/GLTFLoader.js

@@ -1238,7 +1238,7 @@ THREE.GLTFLoader = ( function () {
 
 						}
 
-						var material = dependencies.materials[ primitive.material ];
+						var material = dependencies.materials !== undefined ? dependencies.materials[ primitive.material ] : createDefaultMaterial();
 
 						var meshNode = new THREE.Mesh( geometry, material );
 						meshNode.castShadow = true;