|
@@ -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 + '".' );
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|