[Blender] How to export animations only (like Elf.glft)

Hi everyone,

I would like to replicate what was done with the Elf, here:

In action: https://playground.babylonjs.com/#UGD0Q0#62
Assets: https://github.com/BabylonJS/Assets/tree/master/meshes/Elf

They somehow managed to export animations only. The elf_die.gltf only contains a couple of empties (refering to the original bones) and the actual action: no armature, no meshes.

This is just magic to me. Does anyone know how to do this?

Best wishes

Oh no: It might be impossible because I found this in the source of the elf.gltf:

..."generator":"babylon.js glTF exporter for 3dsmax 2019 v1.5.0"}, ...

cc @PatrickRyan , I don’t know if you can export only the animation data without the skeleton of the mesh…

@Joe_Kerr, I believe this will work, but it is a little bit of a workaround. If you have a skinned mesh and skeleton in your scene, turn off visibility for your mesh(es) and just have the armature visible in the scene.

Then you want to make sure in your glTF export options that you have export limited to Visible Objects and also have Animation enabled with whatever options you want for your motion:


Then you should just get the armature and animation curves. I did not test this with retargeting to a skinned mesh with a similar skeleton, but it appears that will work fine. I checked both the glTF json which appeared to have reasonable data for the animations and looking at it in the inspector, I can see an animation ground and targeted animations with keyframe data in them. Obviously, without a mesh to render, we can’t see the animation in the scene and the play buttons won’t do anything as the engine optimization ignore these animation as there is nothing to render. But retargeting to another mesh should work fine.

I also tried the workaround of selecting only the armature and then exporting limited to Selected Objects, but that flow didn’t work. Either I missed selecting something that needed to be selected or Blender doesn’t consider an armature without a mesh a candidate for selected export. In either case, it was more annoying to have to expand and select the whole armature than it was to hide the mesh so I don’t see a reason to figure out if there is a valid “Selected Objects” route.

Hope this helps.

1 Like

Yes, super cool solution, thanks @PatrickRyan :slightly_smiling_face:

To confirm, retargeting works perfectly fine. Alternatively you can also use “Selected Objects” and select the animations root node in the outliner.

I also tried to hide Armature and Meshes. But you just get an almost empty .glb. Same goes for selecting actions via script (bpy.data.actions → fCurve.select = True). Oh well.

1 Like