[Bf-python] going form head/tail/roll to matrix formula?

Martin Poirier theeth at yahoo.com
Tue Feb 15 01:09:52 CET 2011


Hey Bassam,

You'll want to look at mat3_to_vec_roll in /source/blender/blenkernel/intern/armature.c

Basically, it's taking the Y component of the matrix as the head->tail vector, reconverting that to a matrix as a bone with a roll of 0.0 and calculating the rotation difference between the original matrix and the computed one.

Martin

--- On Mon, 2/14/11, Bassam Kurdali <bkurdali at freefac.org> wrote:

> From: Bassam Kurdali <bkurdali at freefac.org>
> Subject: [Bf-python] going form head/tail/roll to matrix formula?
> To: bf-python at blender.org
> Received: Monday, February 14, 2011, 5:24 PM
> Hey pythoneers, riggers
> was hoping someone could help with this:
> 
> In 2.49 we could write in python to the bone matrix- made
> doing
> transforms very easy.
> 
> In 2.5 this is now read only (no problem-lets convert to
> head/tail/roll
> and write those) but going from the matrix to
> head/tail/roll (or back)
> is something I have not been able to figure out.
> 
> There must be a set of formulas for this, so if anybody
> knows, please
> reply here.
> 
> suggestion: a utility function in geometry module might be
> nice.
> 
> Thanks
> Bassam
> 
> 
> 
> _______________________________________________
> Bf-python mailing list
> Bf-python at blender.org
> http://lists.blender.org/mailman/listinfo/bf-python
> 





More information about the Bf-python mailing list