提交 7fb4c768 编写于 作者: M Mr.doob

GLTFExporter: Handle Group in processObjects() instead.

上级 07c5d9ae
...@@ -2,7 +2,6 @@ import { ...@@ -2,7 +2,6 @@ import {
BufferAttribute, BufferAttribute,
ClampToEdgeWrapping, ClampToEdgeWrapping,
DoubleSide, DoubleSide,
Group,
InterpolateDiscrete, InterpolateDiscrete,
InterpolateLinear, InterpolateLinear,
LinearFilter, LinearFilter,
...@@ -75,7 +74,7 @@ class GLTFExporter { ...@@ -75,7 +74,7 @@ class GLTFExporter {
/** /**
* Parse scenes and generate GLTF output * Parse scenes and generate GLTF output
* @param {Object3D or [THREE.Object3D]} input Object3D or Array of THREE.Object3D * @param {Scene or [THREE.Scenes]} input Scene or Array of THREE.Scenes
* @param {Function} onDone Callback on completed * @param {Function} onDone Callback on completed
* @param {Object} options options * @param {Object} options options
*/ */
...@@ -366,7 +365,7 @@ class GLTFWriter { ...@@ -366,7 +365,7 @@ class GLTFWriter {
/** /**
* Parse scenes and generate GLTF output * Parse scenes and generate GLTF output
* @param {Object3D or [THREE.Object3D]} input Object3D or Array of THREE.Object3D * @param {Scene or [THREE.Scenes]} input Scene or Array of THREE.Scenes
* @param {Function} onDone Callback on completed * @param {Function} onDone Callback on completed
* @param {Object} options options * @param {Object} options options
*/ */
...@@ -1961,9 +1960,20 @@ class GLTFWriter { ...@@ -1961,9 +1960,20 @@ class GLTFWriter {
for ( let i = 0; i < objects.length; i ++ ) { for ( let i = 0; i < objects.length; i ++ ) {
const object = objects[ i ];
// We push directly to children instead of calling `add` to prevent // We push directly to children instead of calling `add` to prevent
// modify the .parent and break its original scene and hierarchy // modify the .parent and break its original scene and hierarchy
scene.children.push( objects[ i ] );
if ( object.isGroup ) {
scene.children.push( ...object.children );
} else {
scene.children.push( object );
}
} }
...@@ -1990,7 +2000,7 @@ class GLTFWriter { ...@@ -1990,7 +2000,7 @@ class GLTFWriter {
for ( let i = 0; i < input.length; i ++ ) { for ( let i = 0; i < input.length; i ++ ) {
if ( input[ i ] instanceof Scene || input[ i ] instanceof Group ) { if ( input[ i ] instanceof Scene ) {
this.processScene( input[ i ] ); this.processScene( input[ i ] );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册