瀏覽代碼

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

Takahiro 8 年之前
父節點
當前提交
e23b03b483
共有 1 個文件被更改,包括 3 次插入1 次删除
  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 );