[Bf-python] More on Bone.getRestMatrix() and bones

Nick Lawson vektuz at cox.net
Fri Jun 10 22:30:51 CEST 2005


My initial impression was that the restmatrix was the matrix of the bones at
rest... which is completely un-useful for exporting baked animations.

Then, after looking at the actual usage (most exporters using it use it to
retrieve animation frames, and its always retrieved animation frames), I had
the new impression that the 'rest matrix' was actually the 'rest of the
matrices concatenated'... ie, local space, without the parent.  Parent
Matrix multiplied by [The Rest of the Matrices].  This sounds kind of silly
too...

Either usage sounds strange... but as far back as I can remember,
getRestMatrix has been returning a different result based on animation
frame/pose, so its definitely been animating all this time.

Perhaps it should be renamed to a more obvious name
("getCurrentPoseMatrix"), and the rest functionality added as
("getRestPoseMatrix").  However, from an exporter stand of view, the rest
pose can be any given pose (the reference frame), and is somewhat
arbitrary... any frame will do as a reference, as long as the system is
consistent.

	Another way to retrieve the current pose would be to go through the
IPO system, but that just doesn't work when you have baked, blended actions,
combined with regular objects, parented to normal objects, and want to
retrieve the armatures matrix with all things considered, if you're doing a
cutscene, for example.

Perhaps a 'getBoneMatrix' that can take
'parentspace','bonespace','worldspace', and an additional parameter of
whether to retrieve the initial pose, or the current one...

-Nick

-----Original Message-----
From: bf-python-bounces at projects.blender.org
[mailto:bf-python-bounces at projects.blender.org] On Behalf Of Ken Hughes
Sent: Friday, June 10, 2005 1:09 PM
To: Blender Foundation Python list
Subject: [Bf-python] More on Bone.getRestMatrix() and bones

I've decided to try torturing myself and have started looking into
what the bone/armature code does (not just the Python wrapper, the
actual code).  This post is aside from that.

My understanding, based on the Blender documention on armatures objects:

http://www.blender.org/modules/documentation/htmlI/x7107.html

is the rest position is the initial position of the bones: without
posing or animation.  If so, isn't this what getRestMatrix() should
be returning?  From bug #2230 (Nick Lawson's bug), the rest
matrix being returned after animation is wrong, but seems to me
like it should never change.  There should instead be another
method (at least) which returns the just the pose matrix?

Ken
_______________________________________________
Bf-python mailing list
Bf-python at projects.blender.org
http://projects.blender.org/mailman/listinfo/bf-python




More information about the Bf-python mailing list