[Bf-python] More Proposed API changes.

Toni Alatalo antont at kyperjokki.fi
Mon Mar 12 13:36:15 CET 2007


Campbell Barton kirjoitti:
> http://members.optusnet.com.au/cjbarton/BPY_API/Bpy-module.html

nice.

i am concerned about having the module auto-imported though. "explicit 
is better than implicit". nothing like that is usually automagically 
'there' in python. admittedly, as bpy is embedded, it makes sense that 
the embedded env is there (it is already loaded in memory - which is 
what import normally does). but i think it can be confusing: we get two 
kinds of scripts, ones with Blender imported and others where bpy just 
is there .. what if we later want/need to change so that some other name 
is used for some other kind of module? like there is the alternative 
'blendit' module. also there is the remote chance of a conflict: someone 
wanting to use a py script in Blender that has the name 'bpy' - without 
explicit import he can not do 'import bpy as bpython' or whatever could 
be used otherwise to avoid it.

so i am concerned. not die-hardingly objecting, but if there would be a 
vote i think i'd object autoimporting, to be on the safe side. and i 
think it is nice that you can see from the top of the file which api it 
is using .. also to not confuse bpy files with normal py files. perhaps 
i would accept bpy autoimported for files with extension .bpy :) 
(although a .py as a textblock inside a .blend can perhaps be regarded 
as a bpy script too .. except that someone may put general 
non-blender-depending py code to blends too, in which case it'd be nice 
again to see from the top of the file if that code needs bpy or not)

~Toni

> Martin Poirier wrote:
>> --- Stephen Swaney <sswaney at centurytel.net> wrote:
>>
>>> You can call the examples 'Use Cases' if you want to
>>> be a hip, sexy OO guy.
>>
>> Use cases predates the OO philosophy.
>> </comp sci nazi>
>>
>> ;)
>>
>> Martin
>>
>>
>>  
>> ____________________________________________________________________________________ 
>>
>> Food fight? Enjoy some healthy debate in the Yahoo! Answers Food & 
>> Drink Q&A.
>> http://answers.yahoo.com/dir/?link=list&sid=396545367
>> _______________________________________________
>> Bf-python mailing list
>> Bf-python at projects.blender.org
>> http://projects.blender.org/mailman/listinfo/bf-python
>>
>
>





More information about the Bf-python mailing list