I wrote an exporter for blender models that works great for meshes. I'm attempting to extend that to bones defined in blender. However I haven't found good information for exporting bone data. How can I access bone data? I'd like access all the vertices that the bone affects, the weight of each vertex and the matrix. Do I need to export anything else for skeletal animation and dynamic dismemberment?

I'd reply but my suggestions suck (not happy with them, and not at all transferrable), and I was hoping you'd get a good answer. I currently do the rigging in my game, and just export with a .obj, all my animation is procedural. I started off trying to read from a Collada export but it's a horrible, horrible format. Let me know if you have luck with writing the python exporter.
–
MichaelDec 16 '11 at 7:13

3 Answers
3

My suggestion is honestly just to find a format that Blender will export its bones as well, and then look through the script of that format exporter. I was doing something similar and realized how much of a pain it was to find a good resource on exporting bones.

Neat, that looks like it has some of what I need. However, it doesn't have a list of the vertices the bone encompasses or the weight of those vertices. I see that it has a bool to show that a bone uses vertexgroups, but I don't see how to access that information. It seems that Blender must be able to export that data. Anyone know how to get to it?
–
Byte56♦Dec 12 '11 at 15:45

2

Looks like I may be on to something. Since Blender uses vertex groups to define the groups for bones, I can just find the vertex group with the same name as the bone, and I've found all the vertices that belong to that bone.
–
Byte56♦Dec 12 '11 at 22:22

Sounds great :]. Sorry I couldn't help further than what I did, I had a similar, but slightly different project. So I hadn't more information.
–
FullyLucidDec 15 '11 at 23:13

This format exports not only the mesh information (vertices, triangles, quads, textures, etc), but also exports armature information, including the armature structure (parent/child relationships), transform matrices, which vertices are included in each bone and even the bone weights for each vertex. Animation sequences are exported too.

All in a human readable ASCII format, so it's easy to write an importer. Beautiful.

The IQM (Inter-Quake Model) format has a set of Blender exporters that will export skinned meshes with blend weights and the armature. Look to http://lee.fov120.com/iqm/ for documentation and code. You could also look at the Doom 3 format MD5 exporters.