[Bf-python] More Proposed API changes.

Campbell Barton cbarton at metavr.com
Fri Mar 9 06:41:07 CET 2007



Joe Eagar wrote:
snip

> Could blend have only data that lives in the actual open file?
> 
> For library data, we could have libblends, linkedblends, library, or 
> something like that that provides the same iterator functions.
> 
> Joe
> 

Practically I dont think this would make life easier for scripters.

Id prefer to make the local/referenced distinction optional rather then 
forcing the scripter to deal with 2 dataIterators in cases there they 
might just want an object of a certain name,

If data is seperated like this, it makes things like collecting all 
objects messy...

obs = [ob for ob in libblends.objects]
obs.extend([ob for ob in linkedblends.objects])

Id prefer the existing new method
obs = [ob for ob in blend.objects]

And if library spesific stuff is needed
obs = [ob for ob in blend.objects if ob.lib == '//foo.lib']

just calling them linkedblends, is also not specific since there would 
be data from any number of linked libs. all they have in common is 
blender shouldent change them.

Its also wouldent be consistent with other iterator types - scn.objects 
and group.objects - both have mixed local/external data. and I dont 
think dividing a scenes objects into local/external data would be good.

Linked data is delt with the same way as local data from Blender, - you 
can type in the name of a linked data in the ID buttons, on the 
databrowser, oops and outliner they are are together, and of course they 
are mixed in the same linked list..






More information about the Bf-python mailing list