Little story about blend files



as some of you already know from IRC, I am playing around with blend files (blender saves). This may be totally worthless, but at least I had some exercise with groovy :)

So blend files are somehow interesting. What blender does is just serializing its memory and internal state of all relevant objects into a binary form. In addition (and thats the cool thing), they store the structure of the serialized objects right in the file, too. So its just some lines of groovy code to access all the objects from the blend file.

Extracting the mesh data and bone structure is not that difficult. You may compare the md5mesh exporter python script [1] with the relevant code using the blender importer [2].

The result is much the same in both cases, but my solution creates much more vertices. This is because the py export script uses a triangle tesselator (built in in blender) while my script doesnt. The tesselator outputs triangles, that use shared vertices for connected triangles.

Now the real problem are animations. What the export script does, is playing the animation and capture the bone positions every step. This way, the export script works with every animation feature, blender offers. In contrast, using my blender loader, you can access the actions that lead to a specific animation, but not the actual positions.

However, this may be useful some day or for someone.