浏览代码

Clean up GLTF2Loader

Takahiro 8 年之前
父节点
当前提交
ceb706b04c
共有 1 个文件被更改,包括 5 次插入2 次删除
  1. 5 2
      examples/js/loaders/GLTF2Loader.js

+ 5 - 2
examples/js/loaders/GLTF2Loader.js

@@ -2688,8 +2688,9 @@ THREE.GLTF2Loader = ( function () {
 
 							}
 
-							//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 );
+
 							for ( var childrenId in group.children ) {
 
 								var child = group.children[ childrenId ];
@@ -2786,10 +2787,12 @@ THREE.GLTF2Loader = ( function () {
 
 								}
 
+								clonedgroup.add( child );
 
-								clonedgroup.add(child);
 							}
+
 							_node.add( clonedgroup );
+
 						}
 
 					}