[Bf-python] mathutils

Willian Padovani Germano wgermano at ig.com.br
Sat Nov 15 17:38:04 CET 2003


Hi,

About the new vgrouping methods: sure, those are necessary additions.
That's your area ; ), will you implement them, Joseph?

> In addition to this there needs to be a way for the user to create a
vector
> and a matrix to pass around to the mathutil funtions don't you think? I
was
> thinking that they pass 1 list for a vector, and 3 or 4 lists for a matrix
> (you probably need a 3x3, and a 4x4 i guess).
> Maybe:
> myVec = Mathutils.Vector([2,2,2])
> my4x4Matrix = Mathutils.Matrix([2,3,4,6],[3,4,5,0],[6,6,8,0],[5,0,4,0])
> That way you simply throw these around at the pyfuncs. Like:
> my4x4IMat = Mat4Invert(my4x4Matrix)

Yes, good idea.  Consider as a guide NMesh.Vert(x,y,z), that returns a new
blender vertex type.  There are similar functions (internal) for matrix and
vector, you can write new ones to create and return vector and matrix
bpython objects using them.

Then users simply create and pass around these objects.  This makes it
easier to wrap the Blender math functions, since these objects store
directly the C values.

--
Willian, wgermano at ig.com.br




More information about the Bf-python mailing list