Issues in exporting Hierarchy of nodes

Hi everyone,

Recently, I want to export the scene in either .babylon or .glb format.

The issue I met is both the babylon and glb exporter failed to persist the hierarchy of the nodes.

This time I managed to re-produce the issue below:
(https://playground.babylonjs.com/#NRNBMM#670)

So far it only happens when parent transformNode has a mesh with children + another child transformNode. Due to losing the transform matrix in the parent node, the location of these child nodes are not in correct locations.

Original Hierarchy

Exported Hierarchy

I am not sure if it is a bug or as design in BJS, any suggestion will be helpful.

Many thanks.

babylon export is a bit weird indeed. Maybe for some reason @PatrickRyan ?
But I’ve just tried .glb export and the hiearchy is preserved.

1 Like

Thanks @Cedric for your quick reply.

Strange, I tried glb option it seems working in my PG…, but not the .babylon format.

My original code is using glb and babylon, but it failed for the same symptom, then I tried to reproduce it in PG.

I might forget to try glb in the PG.

If anyone can provide some details of the cause behind the .babylon exporter. It might help me to understand why it is not working with glb in my original code.

I will try to reproduce the glb case in the PG in the meaning time.

Many thanks.

1 Like

seems like a bug to me :wink:

Let me check!

1 Like

Ok this is not a bug :slight_smile: You cannot use abstractMeshes as they are abstracts :slight_smile: This means they do not have all the info to be used (for instance they do not support serialization)

Here is a fix of your PG:
Parenting Example | Babylon.js Playground (babylonjs.com)

1 Like

Thanks @Deltakosh . That explains the case in my PG.

It seems it is not the same issue with my original code (although I tried my best to reproduce it in PG).

Here is some description of the original issue i met.
The logical is similar, the difference is that the hierarchy is built dynamically with the camera. I cannot figure any fundamental difference with the PG. But I realize that some of the node has “Link to Parent” value and with “None” under Parent. I tried to re-produce it, but failed.

I understand it is quite difficult to offer any help from your side. But in case you have any clue, that would be very helpful.

Have a good day.

Can you share a tiny extract of your scene in Babylon format maybe?

Thanks @Deltakosh .

Please find a sample link below. As I said the hierarchy is totally lost when I open it in sandbox. Would be very helpful if you find any clue from it.

Have a nice weekend.

I see a bit of hiearchy:

What was expected?

Thanks @Deltakosh .

These are the mesh objects should attached to their corresponding parent tranformNode at different level.

But when i export it to .babylon or .glb, the hierarchy is lost. Most of the level transformNode is removed and all child mesh nodes parents become null.

The symptom is similar as my PG example, but may with difference cause. As there is no AbstractMeshNode used in the original case.

Without a repro, the only think I can think about is the use of doNotSerialize on your nodes?

Thanks @Deltakosh .

No, I am not using doNotSerialize to the nodes.

As new to BJS, I always met quite strange issues…

I will update the thread in case i have any progress.

Many thanks again and have a nice weekend.

Can you share a repro? Even privately?

Thanks @Deltakosh .

I will tidy up the code a bit and share it.

1 Like