[Bf-python] Small omitted functions

Kaal_le_Saint Kali.tm at wanadoo.fr
Mon Sep 20 09:20:41 CEST 2004


C'est marrant mais ce script me dit quelque chose ?!

Les grands esprits se rencontrent MDR ^^



-----Message d'origine-----
De : bf-python-bounces at projects.blender.org
[mailto:bf-python-bounces at projects.blender.org] De la part de Campbell
Barton
Envoyé : lundi 20 septembre 2004 01:35
À : Blender Foundation Python list
Objet : Re: [Bf-python] Small omitted functions

I just used makeActive because its the same as myscene.makeActive - But 
I thaught teh same thing-
Also World.GetActive() uses the word active so I thaught it logical- If 
your worried about the Capitals well the are accsessed in a slightly 
different way.

Blender.World.GetActive()
myScene.makeActive()

I personaly think that keeting it simple is good, many commands the 
setFoobar() style naming

why not setActive, set is mode used, active is more catchy then current, 
active makes it sound like it actually does somthing, where as a current 
sounds more edible and useless.

on the other hand-

Current and active are slightly different-
eg- There can only be one current scene, but each scene has 1 active world.

Still, it go setActive-

The attached file is a WIP post processing script, it needs to be able 
so set the active world- It renders a fake zbuffer using mist-

- Cam



>Campbell Barton wrote:
>  
>
>>This is the world.makeActive() function- Needs to be added to World.c in
>>the Python Dir, its quite simple, as for mist- This can be toggled with
>>the mode- setMode and getMode
>>
>>Its just not documented yet.
>>
>>- Cam
>>
>>/* world.makeActive */
>>static PyObject *World_makeActive (BPy_World *self)
>>{
>>    World *world = self->world;
>>    /*If there is a world then it now has one less user*/
>>    if(!G.scene->world) G.scene->world->id.us--;
>>    world->id.us++;
>>    G.scene->world = world;
>>    Py_INCREF(Py_None);
>>    return Py_None;
>>}
>>    
>>
>
>"Where is the rest of it?", he said with a grin.
>hint: a patch would be even nicer.
>
>Naming Conventions
>
>While we are at it, this might be a good time for
>some discussion of naming.  We seem to be jumping
>back and forth in the bpy code between
>setActive
>setCurrent
>makeActive
>makeCurrent
>
>It would be nice to have some sort of convention for this.
>Makes life simpler for the user when things all work the
>same way.  Blender's view manipulation commands are an
>example of this.
>
>Personally, I have no preference between {make | set } and
>{Active | Current }.  Some consistency would be good, however.
>  
>


-- 
Campbell J Barton

133 Hope Street
Geelong West, Victoria 3218 Australia

URL:    http://www.metavr.com
e-mail: cbarton at metavr.com
phone: AU (03) 5229 0241





More information about the Bf-python mailing list