[Bf-python] More Proposed API changes.

Campbell Barton cbarton at metavr.com
Fri Mar 9 18:00:11 CET 2007


Hey Stivs, I should have been more clear..

Blender.DataBase.objects or Blender.DB.objects are fine replacements for 
the name "Main"


However Id like to import this module by default as willian suggested.

DB or DataBase by its self is out of context and I think we need a name 
thats blender specific.

Im not convinced "blend" is bad for the reasons you give.

Possible names for automatically imported module that will replace 
Blender.Main ...
* blend - short and obvious, confuses too much with a .blend file
* blender - too much like "Blender" - otherwise ok
* bpy - nice and short, dosnt tie us down to only using it for data 
access like the name dataBase does, unlikely anyone will be using this 
name in existing scripts.. a bit cryptic tho..
* bpython - same as above but less cryptic


it would be really nice to pop up a text window and write a short useful 
script like...


bpy.scenes.active.camera = bpy.objects['mycamera']


without having to import Object, Scene... or *


Stephen Swaney wrote:
> On Fri, Mar 09, 2007 at 05:17:11PM +1100, Campbell Barton wrote:
>> At some point I suggested database for accessing blender objects and 
>> Theeth gave a very convincing argument as to why this wasnt logical 
>> Blender data dosnt match a database or some such arg.
> 
> I would be interesting in hearing that argument.
> 
> 
>> db or DB are more likely to be variable names in existing python scripts 
>> too. - DB isnt blender spesific, "blend.objects" - reads as a blender 
>> object DB.* isnt obviously blender data, tho its not that strong an 
>> argument, Id also prefer to have the new API all lowercase, and 
>> camelCaps where 2 words are used...
> 
> We can call it DataBase.  DB was just a suggestion.  'Data' is fine.
> 
> 
>> Since the data under "blend.*" or "DB.*" may also have user preferences 
>> with blend.config I dont think blend should be limited to data access only,
> 
> Here we are going back to something like 'Globals'.
> 
> 
>> My vote is to have "blend" - after thinking about it some. external data 
>> is a part of the blend file even if its stored elsewhere.
> 
> The problme I have with 'blend' is the word is so strongly associated 
> with the .blend file.
> 


-- 
See MetaVR Visuals Used at the Combat Studies Institute
http://www.metavr.com/casestudies/baghdadviews.html

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