[Bf-python] Partial proposal for armature+bone modules

Willian Padovani Germano wgermano at ig.com.br
Sat May 24 06:42:35 CEST 2003


Hi, Jordi, sorry for not answering faster

On Wed, 2003-05-21 at 11:16, Jordi Rovira i Bonet wrote:
> Hello,
>   Here's the first proposal for the Armatures module in the experimental 
> python API.
>   Missing things :
>     - access to vertex weights!
>     - modification of the hierarchy
>     - actions
> 
>   Notes:
>     - the bone module gets initialized inside the armature module
>     - It is possible to wrap a NULL bone (when asking for the parent of 
> a bone, for example) This is a temp solution, maybe i should implement a 
> "has_parent" query, because it would be simpler.

Yes, a .has_parent function would be useful, but shouldn't the function
that returns the parent of a bone simply return Py_None when there's no
parent ?

>   I've tries to take into account the last discussion on the list (i've 
> implemented "the 3 functions"), but maybe i've missed something.
>   Of couse, comments are welcome.

You asked ... here they are.  Most are probably useless, but just in
case one or two can be useful:

> /* Function:              M_Armature_Get                                         */
The Get functions in the basic modules (the ones available in bpython
that we already implemented) have already been completed.  Now they
return a list of all objs of their type when no argument is given to
.Get()
 
>     assert(current);
asserts are good for testing, but remember to use a gentler solution
before we commit this to cvs.

> /* Function:    ArmatureCmp                                                  */
> static int ArmatureCmp (C_Armature *a, C_Armature *b)
> {
>   if (a<b) return -1;
>   else if (a==b) return 0;
>   else return 1;
> }
The pointer comparison is already done, for example, in Camera.c
The only relevant answers there are yes (they wrap the same Blender obj)
or no, they don't.

When it proved relevant, we could return "<" or ">" for some module,
based on something else.  I mean: if they don't point to the same thing,
compare some other data and return "<" or ">" based on that comparison. 
Ex: for cameras we could compare their names or distance from (0, 0, 0)
or whatever.  But until that proves useful, no need to do this for
cameras or lamps or ...

You're doing a pretty good job on probably the most wanted new module
for Blender, congrats : ).

Now this is for all module writers: the most important things is to get
basic functionality ready and documented before 2.28.  Try to make sure
all you added works as it should, write a simple .txt description of the
attributes and functions (you can include more stuff after we get the
basic doc layed out) *and* also of the functionality.  For example,
Jordi: a brief description of Armature/Bones in Blender, what they are
used for, which other modules they need, etc.  One or two paragraphs
should be enough.  Remember many newbies will try to work with this and
giving them basic info now will save you from answering many questions
later.

--
Willian, wgermano at ig.com.br




More information about the Bf-python mailing list