Browse Source

#11745 GLTF2Loader removes extras from mesh
added group node inbetween node and meshnodes

Wittmann Tobias 8 years ago
parent
commit
44f1ef9b94
1 changed files with 7 additions and 2 deletions
  1. 7 2
      examples/js/loaders/GLTF2Loader.js

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

@@ -2652,6 +2652,11 @@ THREE.GLTF2Loader = ( function () {
 
 							}
 
+							//do not clone children as they will be replaced anyway
+							var children = group.children
+							group.children=[];
+							var clonedgroup = group.clone();
+							group.children=children;
 							for ( var childrenId in group.children ) {
 
 								var child = group.children[ childrenId ];
@@ -2746,10 +2751,10 @@ THREE.GLTF2Loader = ( function () {
 
 								}
 
-								_node.add( child );
 
+								clonedgroup.add(child);
 							}
-
+							_node.add( clonedgroup );
 						}
 
 					}