Explorar el Código

Remove special casing for `node.meshes`

Daniel Hritzkiv hace 8 años
padre
commit
129ea49e81
Se han modificado 1 ficheros con 9 adiciones y 27 borrados
  1. 9 27
      examples/js/loaders/GLTFLoader.js

+ 9 - 27
examples/js/loaders/GLTFLoader.js

@@ -2171,37 +2171,16 @@ THREE.GLTFLoader = ( function () {
 			] ).then( function ( dependencies ) {
 			] ).then( function ( dependencies ) {
 
 
 				return _each( __nodes, function ( _node, nodeId ) {
 				return _each( __nodes, function ( _node, nodeId ) {
-
+	
 					var node = json.nodes[ nodeId ];
 					var node = json.nodes[ nodeId ];
 
 
-					var meshes;
-
-					if ( node.mesh !== undefined) {
-
-						meshes = [ node.mesh ];
-
-					} else if ( node.meshes !== undefined ) {
-
-						console.warn( 'THREE.GLTFLoader: Legacy glTF file detected. Nodes may have no more than one mesh.' );
-
-						meshes = node.meshes;
-
-					}
-
-					if ( meshes !== undefined ) {
-
-						for ( var meshId in meshes ) {
-
-							var mesh = meshes[ meshId ];
-							var group = dependencies.meshes[ mesh ];
-
-							if ( group === undefined ) {
+					var mesh = node.mesh;
 
 
-								console.warn( 'THREE.GLTFLoader: Could not find node "' + mesh + '".' );
-								continue;
+					if ( mesh !== undefined) {
 
 
-							}
+						var group = dependencies.meshes[ mesh ];
 
 
+						if ( group !== undefined ) {
 							// do not clone children as they will be replaced anyway
 							// do not clone children as they will be replaced anyway
 							var clonedgroup = group.clone( false );
 							var clonedgroup = group.clone( false );
 
 
@@ -2302,8 +2281,11 @@ THREE.GLTFLoader = ( function () {
 							}
 							}
 
 
 							_node.add( clonedgroup );
 							_node.add( clonedgroup );
+						} else {
 
 
-						}
+							console.warn( 'THREE.GLTFLoader: Could not find node "' + mesh + '".' );
+
+						}                            
 
 
 					}
 					}