Armatures, Bones & IPO Curves.


#1

I’ve written a Python exporter that saves out Armatures, Bones & IPO Curves - along with all of the data that blender lets you grab for those objects. Now I’m trying to make sense of what I see…and I’m having ZERO luck with it! I have the simplest test model imaginable - two bones with two cubes…one of which rotates 90 degrees around the Y axis and back again. You can grab it at http://sjbaker.org/tmp/kiss_animation.blend along with the XML file that my Python exporter produced from it (which basically just writes out all of the blender structures without doing anything to them…yet): http://sjbaker.org/tmp/kiss_animation.xml

I have the per-vertex blendweight and blendindex stuff all figured out and I’ve written a shader that I’ve carefully tested and I know works to transform the vertices correctly, given a set of bind-to-pose matrices, one per bone per time-step.

The problem is that I’m having a terrible time understanding what the numbers that my Python exporter extracts actually MEAN. On the BONE objects, I see ‘armaturespace’ and ‘bonespace’ with both head and tail positions for each, also a 4x4 armaturespace matrix and 3x3 bonespace matrix - also a bonespace roll angle and a length…plus curve data for the X,Y,Z,W components of a quaternion rotation and X,Y,Z location for each bone at each time step. I also understand how the bone hierarchy is organized.

However, turning that information into a bunch of bind-to-pose matrices that I can use in my shader to transform the skin vertices is turning into a nightmare! I simply can’t fathom out what all of these numbers are telling me!

For example: My python dump says that the first bone goes vertically up from (0,0,0) to (0,0,1) and the second from (0,0,1) to (0,0,2) - which makes sense - that’s what I see in blender. But the armaturespace and bonespace matrices for both bones mysteriously rotate through 90 degrees around the X axis?!?

WTF?

I didn’t apply any rotations to the bones in the armature when I created it - and I can’t think of any need for a 90 degree rotation - so what does this mean?

What I really need is a simple step-by-step explanation of the order of transform operations to get from a skin vertex in bind-pose to the animated position: given the data exposed to Python in the bone description and the quaternion for a particular timestep…exactly what math do I need?

Thanks in advance…

Steve


#2

this question seem better fit for the guy’s at #blendercoders (channel) on irc.freenode.net (server). :slight_smile:


#3

Yeah - I posted the question to http://www.blender.org/forum - but after two days, no reply. I thought I’d give this a shot. I’ve not had much luck with IRC in the past. It isn’t really a good way for complicated questions because it depends on the offchance that someone who knows the answer happens to be there when you ask.

<sigh>

– Steve.


#4

Just in case somone else is searching for an answer to this…

Someone from the blender team pointed me to this document - which answers the question nicely:

http://www.blender.org/development/release-logs/blender-240/how-armatures-work/


#5

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.