[Bf-python] Adding a new way to deal with libraries
Martin Poirier
theeth at yahoo.com
Sat Mar 10 15:06:37 CET 2007
--- Campbell Barton <cbarton at metavr.com> wrote:
> For now Ill assume "bpy" is acceptable and move
> on... we can of course
> change, as with any part of the new API parts.
>
> next step is to deciede how library data could be
> delt with.
>
> Id like to replace Blender.Library with somthing a
> bit less messy.
> Im not sure they fit into the libdata
> iterator-like way of working
>
> heres an example of how it might work..
> ob =
>
bpy.libraries['//mylib.blend'].objects.link("somedata")
>
> # '//mylib.blend' - could be a new or used lib, if
> its new it would be
> added to bpy.libraries
For library access, I strong recommend moving away
from the Open->Load->Close scheme that is/was used in
Blender.Library. Using atomic operations (which seems
to be what you are suggesting) solves a lot of
potential problems (lib loading in Blender is a bit
magic/messy).
Martin
____________________________________________________________________________________
Get your own web address.
Have a HUGE year through Yahoo! Small Business.
http://smallbusiness.yahoo.com/domains/?p=BESTDEAL
More information about the Bf-python
mailing list