[Bf-python] naming conventions : synthesis of the discussion.

Willian Padovani Germano wgermano at ig.com.br
Mon Jun 23 05:04:01 CEST 2003


Thanks for wrapping this up, Guignot : )

> c) Intern and helper functions : no rule
>
> (Michel) Well, maybe as a guideline, let the functions start with a
capital?
> (Willian) If there was another function in Blender with this name, I
haven't
> tested what would happen.
> (I) probably nothing. And gdb can point at a function using the syntax
> break filename:functionname (or something like this)

Ah, good to know.  Even so, it won't hurt if we prepend something there,
like bpy_ (so that BPY_ is kept for public exppython functions).  Not a big
issue, though.

> (Willian)
> potential clash between Blender types and Python types :
> fix : change the names of the objects to BPy_XXX

I rethought this.  BPy_Object, BPy_Camera, etc.  don't look/sound very good.
I ended up trying "Blender Camera", "Blender Lamp" and these look finer.
For a script writer / user they give the necessary info without going into
our internal names.

And since in the Python Interpreter itself:
print type (1) gives <type 'int'>
print type('a') gives <type 'str'>, etc.

it's natural to have
print type(Blender.Object.New("Mesh")) giving <type 'Blender Object'>
etc.

So unless we find some problem with this (like length limitations), I
suggest we use it.

--
Willian, wgermano at ig.com.br




More information about the Bf-python mailing list