Browse Source

GLTFExporter: Fix cases for nested hierarchies and skipped clips.

Don McCurdy 7 years ago
parent
commit
9ee9509449
1 changed files with 4 additions and 2 deletions
  1. 4 2
      examples/js/exporters/GLTFExporter.js

+ 4 - 2
examples/js/exporters/GLTFExporter.js

@@ -883,6 +883,7 @@ THREE.GLTFExporter.prototype = {
 				if ( ! trackNode || ! trackProperty ) {
 				if ( ! trackNode || ! trackProperty ) {
 
 
 					console.warn( 'THREE.GLTFExporter: Could not export animation track "%s".', track.name );
 					console.warn( 'THREE.GLTFExporter: Could not export animation track "%s".', track.name );
+					return null;
 
 
 				}
 				}
 
 
@@ -1040,7 +1041,9 @@ THREE.GLTFExporter.prototype = {
 
 
 			outputJSON.nodes.push( gltfNode );
 			outputJSON.nodes.push( gltfNode );
 
 
-			return outputJSON.nodes.length - 1;
+			var nodeIndex = nodeMap[ object.uuid ] = outputJSON.nodes.length - 1;
+
+			return nodeIndex;
 
 
 		}
 		}
 
 
@@ -1084,7 +1087,6 @@ THREE.GLTFExporter.prototype = {
 					if ( node !== null ) {
 					if ( node !== null ) {
 
 
 						nodes.push( node );
 						nodes.push( node );
-						nodeMap[ child.uuid ] = node;
 
 
 					}
 					}