SerializeMesh -> ImportMeshAsync: TransformNodes gone

Hi everyone,

Trying to save/load a mesh hierarchy with mixamo rig. It seems all TransformNodes are gone when re-importing: https://playground.babylonjs.com/#XY6QF0#105

N.B. They really seem to be gone (GLTF(2.0) loader not loading empty meshes/"TransformNodes"? - #6 by bghgary) not just not re-parented.

FYI: workaround making a roundtrip via glb https://playground.babylonjs.com/#XY6QF0#104 (this seems unnecessary/inefficient?)

Best wishes
Joe

cc @alexchuber as it might be a bug in the loader/serializer :slight_smile:

1 Like

It looks like the culling of unused (well, apparently not fully unused :slight_smile: ) TransformNodes is an intentional behavior for ImportMeshAsync with .babylon files.

We could instead keep the TransformNodes that are used as bones for any of the meshes in the hierarchy. But I’m wondering,

  • What if the TransformNodes of the bones are not descendants of the target mesh to import?
    For example, what should happen if you import the elf mesh from Elf.gltf, whose skeleton uses nodes that are not descendants of elf?
  • Should we be culling any TransformNodes under the target mesh in the first place?

@Deltakosh Any opinions?

We could also offer the option to not remove the unused ones

Aw, sorry I forgot about this one. FYI: I switched to the GLTF exporter because it turned out to be faster and prduces much less data.

Also, it was actually super easy to build everything back together myself. It is really all about assigning or reparenting. Babylon does the rest. So I did not really need ImportMeshAsync anymore.

2 Likes

This is the way!! :smiley:

2 Likes