Continuing my rigging explorations in touch…

Though the tdu module with its Matrix and Vector class is nice, it is somewhat limited features-wise.

Just came accross the blender-mathutils library, which seems very nice, with quaternions support and useful functions (angle between vectors, rotation order choice for euler decomposition…). Missing the lookat function from touch, though that’s not hard to come up with.

Source : code.google.com/p/blender-mathutils/

Binaries : lfd.uci.edu/~gohlke/pythonlibs/

Docs : blender.org/documentation/bl … utils.html

Now, converting from a touch matrix returned by worldTransform is a bit awkward though, having to loop over all the components, see below.

Would be great to have better support for this library. Or add its functions to the tdu module

[code]world = op(‘testGeo1’).worldTransform

import mathutils

import math

mat = mathutils.Matrix.Identity(4)

for i in range(4):

for j in range(4):

mat[i][j] = world[i,j]

print(world)

print(mat)

eul = mat.to_euler(‘YXZ’)

print(math.degrees(eul[0]))

print(math.degrees(eul[1]))

print(math.degrees(eul[2]))[/code]