[Bf-committers] 'mathutils' module now available standalone

Campbell Barton ideasman42 at gmail.com
Fri Jul 15 23:52:18 CEST 2011


On Sat, Jul 16, 2011 at 5:26 AM, Stephen M. McQuay <stephen at mcquay.me> wrote:
> On Fri, Jul 15, 2011 at 10:17:25PM +1000, Campbell Barton wrote:
>> mathutils is not too dependent on the rest of blender so I've setup a
>> project to allow mathutils to run as a standalone python module.
>
> Is there any reason we don't use NumPy/Scipy?
>
> --
> Stephen M. McQuay
> http://mcquay.me/vcf

>From my brief tests with numpy it doesn't support rotation types, yes
it can be added via python (sub-classed or utility functions added)
like this.
http://www.lfd.uci.edu/~gohlke/code/transformations.py.html

But it doesn't make for as nice an api, and isn't as optimal eg:

 >>> al, be, ga = euler_from_matrix(R0, 'syxz')
 >>> R1 = euler_matrix(al, be, ga, 'syxz')

With mathutils is

 >>> eul = mat.to_euler('YXZ')
 >>> mat1 = eul.to_matrix()


More information about the Bf-committers mailing list