[Bf-python] armatures again

Michel Selten michel.s at home.nl
Tue May 13 22:28:14 CEST 2003


Hi,

I've written some comments about the interface between the lines.

On Wed, 2003-05-14 at 22:02, Jordi Rovira i Bonet wrote:
> /*****************************************************************************/
> /* Python method structure definition for Blender.Armature module:               */
> /*****************************************************************************/
> struct PyMethodDef M_Armature_methods[] = {
>   {"New",(PyCFunction)M_Armature_New, METH_VARARGS|METH_KEYWORDS,M_Armature_New_doc},
>   {"Get",         M_Armature_Get,         METH_VARARGS, M_Armature_Get_doc},
>   {"get",         M_Armature_Get,         METH_VARARGS, M_Armature_Get_doc},

Hrm, we need to decide if we want to maintain 2 get functions which do
exactly the same, but one with a capital and one without. The reason all
other modules contain both, is because of history. Now that the armature
and bone modules are new, we can decide on some standard. This standard
can be applied to the existing modules as well - over time. (I have some
ideas on this, and I already communicated that with Willian, I just need
to send that mail to this list.)

Anyway, after this intro, my idea would be to leave out the "get"
variant and just go for the "Get" function. I think it would be good if
all functions are starting with a capital.

> /*****************************************************************************/
> /* Python C_Armature methods declarations:                                     */
> /*****************************************************************************/
> static PyObject *Armature_getName(C_Armature *self);
> static PyObject *Armature_getBones(C_Armature *self);
> static PyObject *Armature_setName(C_Armature *self, PyObject *args);
> static PyObject *Armature_setBones(C_Armature *self, PyObject *args);

The getName & setName functions can probably be applied to the other
modules as well, or am I mistaken? In that case, I think we should add
them (maybe after 2.28).

Even though the Armature and Bone modules are very related to each
other, I would suggest to split them up. Separate Armature.[ch] and
Bone.[ch] files would be consistent with the other modules.

Maybe another decision that we need to make is: which attributes are
going to be implemented in the 'get_attr' and 'set_attr' functions?
Currently most of the attributes are implemented - because of history.
But now that we are adding those separate functions, do we need another
method for accessing those variables? Providing more options to the user
is nice, but remember that each additional line of code contains a
potential bug and needs maintenance.

Other than that, I think it's a good start! Keep up the good work!

With regards,
	Michel





More information about the Bf-python mailing list