@Raph I've update
io_scene_lua.py for Blender, it's in here:
https://github.com/RNavega/2DMeshAnimat ... r%20Add-on
I used a technique from my other add-ons, branching the code depending on the Blender version. This means that this single script works on all major Blender versions, from 2.79 and up including 3.X.
-----
I've also updated the demo code. After profiling a lot (a lot), I noticed that if I replaced a pairs() call in the middle of the speed-critical code by the equivalent using a numerical index, it became much faster -- I'm thinking because the LuaJIT optimizations were finally able to kick in, whereas they couldn't do that with that pair() call in there.
After more profiling and using the mesh:setVertices() overload that takes in a Data object for the vertex attributes (instead of a Lua table of tables), the overall speed improvement is about 4x. Pretty cool.
Other things:
• The exporter now produces a different file structure that supports multiple UV sets and vertex color sets, as well as multiple objects in the same scene (the previous version tried to merge them all as one huge mesh and one huge armature).
• All bones are exported as parentless floating objects, having world-space coordinates. If you want bone parenting then you'd have to implement a bone hierarchy (making transforms be relative to each other). This would let you do things like real-time IK chains, ragdoll physics and such. Both the exporter and the Lua demo code would have to be modified to support this.
• Because of the speed improvements to the CPU skinning method I removed references to the GPU skinning method. The file is still in the repo for reference, it's just not used because it'd have to be updated to use the new model format and that is homework for whoever is interested in that (like using data textures and vertex-texture-fetching in the vertex shader for having access to lots of shape keys and bones). The CPU skinning method is enough for my needs.
I noticed that LÖVE 12.X will introduce a new vertex buffer API but it will still be compatible with this code. I think it'll involve setting up the buffer and replacing mesh:setVertices() with the new vertex buffer call.