Is it possible to export a loaded Gltf model with animation from the sandbox as .babylon?
Here’s how you do it:
Open the Inspector:
Then go to the tools tab:
Then hit the export to babylon button:
Hope this helps!
Because I load this model
Maybe @Drigax can chime in
Btw when loading the Babylon.js file, do you see animation groups in the inspector?
I don’t think we ever expected this usecase of .glTF->.babylon export, my current guess is that we use linked transform node to drive skeletal animation from imported glTFs, but we don’t serialize that information to .babylon so the animation data is exported, but the bones are disconnected from their drivers on round-trip. hopefully this kinda explains what I mean:
let’s capture it as an issue that we may want to fix in the future (Or ask our great community for help ;))
I think we’re already tracking something similar via:
Its on the list for 4.2, so I don’t mind looking into it, I think I’m getting close here
Thankfully we already have deserialization logic to handle linkedtransform nodes, we just forget to export that data at serialization, but I also noticed that our meshes are missing their skeletons after reimporting:
I’ll see if serializing our skeleton id, and linking it to our loaded mesh after we create our skeletons fixes this
There were a few other fields we needed to serialize like
Bone.linkedTransformNode, and we had to make sure we were preserved the bone ids as well so we properly ignore some of the bones in the hierarchy.