Armature support in Python API?

Scripting in Blender with Python, and working on the API

Moderators: jesterKing, stiv

Post Reply
Posts: 1
Joined: Fri Oct 18, 2002 9:00 am

Armature support in Python API?

Post by sgaffga »

Hi !

Does anybody know how I can access Armatures using the Python API?
I need to export a complete Mesh (Vertices, Faces, UV-Coords, Armatures,
Animation-Keys) to create a model for my GPL 3D-Game....

Except Armatures and Animation-Keys I got everything exported yet...

Thanks and Greetings

Posts: 2
Joined: Mon Oct 14, 2002 8:56 am

Post by skontar »

I am afraid that, as others will confirm later, that there is no way to access Armatures with a python script, in Blender..... Unfortunately we will both (since I was working on a similar project of mine.....), have to wait a bit......

But at least you can access the individual bones Action ipo's. I don't know how this could help you though......

Open the .blend file you are working on and try:

Code: Select all

import Blender
obj = Blender.Ipo.get()
print obj
This is lame, but it will give you, assuming that you have done some animation and have set some action keys, the names of all the action ipo's. I don't know how the action ipo's could be useful in what you want to do, but this is a good start, I guess.........

Hope this helps..........

Infidel difilers. Now they know why they fear night!!! Thulsa Doom.

Posts: 72
Joined: Fri Oct 18, 2002 1:12 am

Post by beatabix »

this is a long shot, but you could try parenting empties to everybone and get the data from there.

you could have some kind of naming convention for the empties so that the script can determine the chain heirarchy of the bones, then use their global co-ordinates in relation to an empty parented at the root of the armature to determine their size and rotation.

of course, you still wouldn't be able to export weight groups and things like that.

do some hacking in the source, see what you can find.

i think the main problem with exporting armature info is that armatures use quaternion rotation, whereas everything else in blender uses euler rotation.


Post Reply