소스 검색

Merge pull request #11757 from twittmann/#11745

#11745 GLTF2Loader removes extras from mesh
Mr.doob 8 년 전
부모
커밋
f716813e05
1개의 변경된 파일4개의 추가작업 그리고 2개의 파일을 삭제
  1. 4 2
      examples/js/loaders/GLTF2Loader.js

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

@@ -2652,6 +2652,8 @@ THREE.GLTF2Loader = ( function () {
 
 							}
 
+							//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 ];
@@ -2746,10 +2748,10 @@ THREE.GLTF2Loader = ( function () {
 
 								}
 
-								_node.add( child );
 
+								clonedgroup.add(child);
 							}
-
+							_node.add( clonedgroup );
 						}
 
 					}