[Bf-taskforce25] Operator Naming Guidelines

Brecht Van Lommel brecht at blender.org
Mon Dec 29 12:38:59 CET 2008


Hi,

On Mon, 2008-12-29 at 10:55 +0000, Domino Marama wrote:
> On Mon, 2008-12-29 at 09:44 +0100, Brecht Van Lommel wrote:
> 
> > * CATEGORY: full upper case without underscores, indicating the 
> > category of the operator.
> 
> Is there a reason for ignoring the pep008 guidelines and using capitals
> in function names? 
> 
> http://www.python.org/dev/peps/pep-0008/

These operator names are not just used for the python API, they are
unique identifiers for operators. I did not mention this, but I don't
think the CATEGORY part of the identifier should be part of the python
function name. Rather, it can define the name of the module (after it is
converted to lowercase). So the actual python API would be:

view3d.select_all()
object.clear_parent()

Though that is also a bit confusing, as it is not immediately obvious
that those are module names and context sensitive function calls.

> > docs for bpyoperator
> >
> http://www.graphicall.org/ftp/ideasman42/html/bpyoperator-module.html
> 
> It's hard to tell what ACT_ is an abbreviation of - action, active,
> actor or something else?

I agree this name should be longer, as mentioned in the proposed
guidelines.

Brecht.




More information about the Bf-taskforce25 mailing list