Convert/export animations of the same character in file .json

Hi guys, premising that I am a 3d modeller and not a great connoisseur of threejs and programming languages, I need some clarification : I have a 3d character that needs several animations (many, probably more than 100). I have studied the main workflow used in threejs to import the model and the animations and I have done the following : I have exported from Blender my character with rig, texture and skinning in glb assigning him a basic animation (idle) and then I am exporting several glb files that include only the data of the other animations (no mesh, no rig, no skin), so as to make the glb files (only animations) lighter and obviously callable on my Main character via script. Everything works well and regularly.
However, since there are so many animations (and so many glb files take their toll after a while), I thought of translating the animations (key frames of the bones, rotation behaviour, position, etc.) from Blender/Maya or any other 3D programme that could do it, no longer in glb, but in .Json files, so that they would weigh as little as possible. I did a lot of research, but it seems that this type of workflow is now obsolete.

Can anyone advise me or can tell me how to properly export/convert animations created by 3d programs into .json files and have them read correctly in threejs?

Thank you all in advance

JSON is not really a lightweight format. I think you’re better off using GLB for the whole thing.

Get your character and all its animations in a single blend file → export GLTF/glb

If you do need to export them in separate files… I think at minimum you have to have an Armature in the scene with the animation applied, for it to export.


Thank you very much for your advice and reply.
I wanted to find a way of exporting my character’s animations by code (e.g. exporting only data that gives me coordinates to move the bones of my rig and thus make up a whole animation lasting a few seconds) and calling them up in threejs in this written format, so that they weigh as little as possible.

I hope I have explained myself correctly and not omitted any basic concepts to understand the scene I have.

Thank you very much again

Can you explain this part further?

However, since there are so many animations (and so many glb files take their toll after a while)

I’ve written apps that use multiple 100s of animations exported in a single GLB and it works just fine.
I’ve also done the same with individual GLBs, each containing ~ 5 animations… and it all worked pretty well.