Ver código fonte

Merge pull request #12007 from proteamer/dev

GLTFLoader: check if material.extra is defined before assign it
Mr.doob 8 anos atrás
pai
commit
05d67cc5b9
1 arquivos alterados com 1 adições e 1 exclusões
  1. 1 1
      examples/js/loaders/GLTFLoader.js

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

@@ -1669,7 +1669,7 @@ THREE.GLTFLoader = ( function () {
 				// https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#materialnormaltexture
 				// https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#materialnormaltexture
 				_material.normalScale.x = -1;
 				_material.normalScale.x = -1;
 
 
-				_material.userData = material.extras;
+				if ( material.extras ) _material.userData = material.extras;
 
 
 				return _material;
 				return _material;