Page 1 of 2

Extracting animation information from an armature

Posted: Mon Oct 10, 2005 2:38 am
by tron_thomas
I have been working with the latest developer versions of Blender to try and export animation information from an armature system via the Python scripting API. When I was working with the shipping version of Blender 2.36, I could accomplish this by setting the current frame to a pose where I wanted to get information about the armature bones. I would then query each bone in the armature and determine how they wer oriented in the scene.

With the latest versions of Blender, I find that when I attempt this same method, the bones always give their rest position information despite how they are posed in the current frame. I know the animation system in Blender has been going under a lot of changes. I don't know what I am experiencing with the latest builds is new expected behavior, or if the functionality is currently broken.

What can I do to find out how to properly extract animation information from an armature system?

Posted: Mon Oct 10, 2005 8:25 am
by LetterRip

the python armature api is being rewritten due to massive changes in the core code, so right now pretty much all python armature code is broken, it should be fixed in the near future.


Posted: Tue Oct 11, 2005 5:28 am
by tron_thomas
I have been working with the code to try to fix some of the problems that have come up.

How can I find out who is working on this so I learn more about what I can do to assist with this?

Posted: Tue Oct 11, 2005 6:07 am
by kakapo

i think ascotan is working on it.

Posted: Wed Oct 12, 2005 4:59 pm
by tron_thomas
I reviewed the posted thread. It does look as though ascotan is working on this.

How do I make contact with this person?

Posted: Wed Oct 12, 2005 5:02 pm
by ascotan
Its me! Hi :P

Posted: Fri Oct 14, 2005 6:16 am
by tron_thomas
I've been looking over the code and found a way to fix the NMesh.getVertexInfluences. I don't know if the way I fixed it is the right solution or not.

What can I do to help get the Python armature API's working?

Posted: Fri Oct 14, 2005 7:31 pm
by ascotan
Well right now there aren't any room for fixes becaue the whole thing is being reworked. I should have an alpha of Armature.c and Bone.c to post to the cvs here very shortly.
It's taken me longer than usual because of RL issues ;/ but i'll get it in there. At that point we all need to take a look and fool around with it.

I put in the vertex method in NMesh many eons ago (it was the first thing i every did (although influences() was someone else's work)). But I'm glad you brought this up becaue this is ANOTHER issues with armatures - rigging.

We'll need to take a look at how a mesh is linked to an armature (as well as other objects) and also examine deformations and how to apply them. Ug.

Posted: Sat Oct 15, 2005 7:26 pm
by tron_thomas
It seems as though redoing everything has the potential to add new features and deprecate old ones.

How will this new implemenation affect the Armature, Bone, and NMesh Python interfaces?

My original interest in working on all of this is that I wanted to export skeletal animation information from Blender. I found that I wanted to be able to export the armature when it was in its rest position so I could determine how all the bones were related to each other.

I was working with Blender 2.36, and from what I could determine, I could only get the relationship of the bones based on their current pose. There was no way through the Python API's to get the rest position information.

I added some featuers to the API that would allow me to get this information. I was going to submit it to the Blender team for review and see if it could be added in. Unfortunately by the time I got around to this, my work was too out of date due to the recent changes that have been made.

How is the new work being done going to support get the rest position information of the armature?

Posted: Sat Oct 15, 2005 11:05 pm
by LetterRip
You might want to submit your patches anyway even if they are out of date, to give an idea of what API interfaces would be useful to you.


Posted: Sun Oct 16, 2005 6:26 pm
by tron_thomas
How can I go about submitting my patches?
Who specifically should I contact?
What exactly should I submit?
How should the information be submitted?

Posted: Sun Oct 16, 2005 6:28 pm
by kakapo
how will b-bones be handled? i could imagine that would be quite tricky. but maybe it's not that important to support them.

Posted: Sun Oct 16, 2005 11:34 pm
by LetterRip
submit patches to the patch tracker, ... unc=browse

directions are here

or you can email a link to them to bf-committers mailing list,


Posted: Mon Oct 17, 2005 4:00 am
by ascotan
There rest position of the armature can be extracted directly from the new revision to the bone struct. The way this is currently accessed (in the alpha armture api is)
arm_matrix = myArmature.bones['mybone.001'].matrix['ARMATURESPACE']
local_matrix = myArmature.bones['mybone.001'].matrix['BONESPACE']
However, this is just the current way of doing things - i'm still working this. We also need to think about time points and posemode editing which i'll deal with later.

B-bone are simple. They are simply regular bone with segments and bezier handles. You can set their properties in the bone and set the armature drawtype to b-bones. easy as pie.

Posted: Mon Oct 17, 2005 3:20 pm
by Bight_Jeremy
Will there be the ability to read the rotation of B-Bone segments in the API? Jus curious since I use Blender for work on video games and I'm quite sure BBones wont export to the engine. If I was able to read the rotations of each segment I could write a script to bake them out to another joint chain that the engine can use and still be able to take advantage of them for doing the animations. Thanks.