Explorar o código

Remove special casing for `node.meshes`

Daniel Hritzkiv %!s(int64=8) %!d(string=hai) anos
pai
achega
129ea49e81
Modificáronse 1 ficheiros con 9 adicións e 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 ) {
 
 				return _each( __nodes, function ( _node, 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
 							var clonedgroup = group.clone( false );
 
@@ -2302,8 +2281,11 @@ THREE.GLTFLoader = ( function () {
 							}
 
 							_node.add( clonedgroup );
+						} else {
 
-						}
+							console.warn( 'THREE.GLTFLoader: Could not find node "' + mesh + '".' );
+
+						}                            
 
 					}