Browse Source

Use uuid for animation target if node.name is not defined

Takahiro 8 years ago
parent
commit
e23b03b483
1 changed files with 3 additions and 1 deletions
  1. 3 1
      examples/js/loaders/GLTFLoader.js

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

@@ -1397,12 +1397,14 @@ THREE.GLTFLoader = ( function () {
 
 						if ( node ) {
 
+							var targetName = node.name ? node.name : node.uuid;
+
 							var interp = {
 								times: inputAccessor.array,
 								values: outputAccessor.array,
 								target: node,
 								type: INTERPOLATION[ sampler.interpolation ],
-								name: node.name + '.' + PATH_PROPERTIES[ target.path ]
+								name: targetName + '.' + PATH_PROPERTIES[ target.path ]
 							};
 
 							interps.push( interp );