Browse Source

Remove leaf node culling from gltf2 exporter.

Nicholas Barlow 5 năm trước cách đây
mục cha
commit
a878ff4883
1 tập tin đã thay đổi với 3 bổ sung6 xóa
  1. 3 6
      serializers/src/glTF/2.0/glTFExporter.ts

+ 3 - 6
serializers/src/glTF/2.0/glTFExporter.ts

@@ -1331,12 +1331,9 @@ export class _Exporter {
                         }
                         else {
                             return promise.then((node) => {
-                                const directDescendents = babylonNode.getDescendants(true, (node: Node) => { return (node instanceof Node); });
-                                if (directDescendents.length || node.mesh != null || (node.extensions)) {
-                                    this._nodes.push(node);
-                                    nodeIndex = this._nodes.length - 1;
-                                    nodeMap[babylonNode.uniqueId] = nodeIndex;
-                                }
+                                this._nodes.push(node);
+                                nodeIndex = this._nodes.length - 1;
+                                nodeMap[babylonNode.uniqueId] = nodeIndex;
 
                                 if (!babylonScene.animationGroups.length && babylonNode.animations.length) {
                                     _GLTFAnimation._CreateNodeAnimationFromNodeAnimations(babylonNode, runtimeGLTFAnimation, idleGLTFAnimations, nodeMap, this._nodes, binaryWriter, this._bufferViews, this._accessors, this._convertToRightHandedSystem, this._animationSampleRate);