# shouldExportNode issue with TransformNode

**URL:** <https://forum.babylonjs.com/t/shouldexportnode-issue-with-transformnode/38872>\
**Category:** Bugs\
**Created:** [March 9, 2023, 5:42am UTC](https://forum.babylonjs.com/t/shouldexportnode-issue-with-transformnode/38872 "2023-03-09T05:42:31Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![arun\_threye](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/arun_threye/32/28665_2.png) [@arun\_threye](https://forum.babylonjs.com/u/arun_threye)\
**Post date:** [March 10, 2023, 4:59am UTC](https://forum.babylonjs.com/t/shouldexportnode-issue-with-transformnode/38872/5 "2023-03-10T04:59:43Z")

</div>

@sebavan I agree that GLB is valid. It is not empty, If you see this in blender, it shows the Cylinder properly. Even If you look at file size, It consist of mesh data. I am proposing a solution further down. A GLB without empty node, loads on Babylonjs Sandbox, but this one gives error despite being valid.

@bghgary The solution that you provided seems to work fine. I also figured out since I posted the question. The challenge is, my GLB file has meshes in a deep nested hierarchy, To separate a mesh which is deep nested seems a big problem.

Proposed behavior :  
We add a flag to export option, to include all parent nodes. It is better to keep the flag, as maintaining hierarchy for meshes is also important for lot of projects. How I implemented workaround is :

```auto
// Using the collectParent Method to get the list of all 
const collectParent = (mesh, array) => {
    if (mesh.parent != null) {
        if (!mesh.parent._isMesh) {
        }
        array.push(mesh.parent.uniqueId);
        collectParent(mesh.parent, array);
    }
}

// element below is mesh that I am trying to export.
const meshCollection = [element.uniqueId]
if (element.parent != null) {
    collectParent(element, meshCollection );
}

```

and then inside `shouldExportNode`, I am then checking if `node.uniqueId` exists in `meshCollection` array created above.

---

_[View the full topic](https://forum.babylonjs.com/t/shouldexportnode-issue-with-transformnode/38872)._
