Explorar o código

Merge pull request #11757 from twittmann/#11745

#11745 GLTF2Loader removes extras from mesh
Mr.doob %!s(int64=8) %!d(string=hai) anos
pai
achega
f716813e05
Modificáronse 1 ficheiros con 4 adicións e 2 borrados
  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 );
 						}
 
 					}