[Bf-python] Object matrix writable?

Willian Padovani Germano wgermano at ig.com.br
Wed May 28 06:21:47 CEST 2003


On Tue, 2003-05-27 at 06:17, Jonathan Merritt wrote:

You provided good reasons for not wanting to write directly to Blender's
own object matrices, that's probably why it is read-only in bpython. 
There are simple situations in which write access would be useful
(involving no parenting), but until someone comes up with one that can't
be done some other way, it's probably better to let things as they are.

> (NB: There is definitely a word for a 
> badly-non-rigid-body transform;

Translations, rotations, scaling and shears are affine transformations
-- parallel lines are kept parallel by any combination of these
transforms.  But line lengths and angles between lines aren't preserved
as with, of course, rigid-body transforms: combinations of arbitrary
translations and rotations.

So affine transfs. in general are non-rigid-body transfs. 
Badly-non-rigid-body ... mmm... what about non-linear transformations,
that's certainly badly-non-rigid : ).

>   3. Provide a method, for render export scripts and the like, which 
> calculates the world-space transform for an object, by contatenating all 
> the transforms in an object's heirarchy together (fast and easy - it's 
> just matrix multiplication).  This matrix is read-only.
> 
> These changes would promote a stricter view of the object tranformation 
> heirarchy than currently exists.
> 
> What does everyone think?

In my own import/export scripts I had to handle these calculations. 
BPython already had all I needed to build the transformations in Python
and apply them to the vertices.  We can always do that -- this kind of
code can be built on top of our current API (once exppython gets 
finished, of course) and is much simpler in Python than in C.

So, the reasons for doing this would be speed (if it's done in C) and to
provide it as time-saver function in a Blender.3dMath module, right?

It's a good idea to have a basic lib with 3d math operations, there's
even some old py code in the blender/intern/python dir.

Also, access to Blender's own matrix / quaternion code through a python
module could be interesting, though I won't look at this possibility
before we "finish" exppython.  It's open, of course, for anyone else
wanting to consider a Blender.3dMath module.

--
Willian, wgermano at ig.com.br




More information about the Bf-python mailing list