Blender Git Commit Log

Git Commits -> Revision 8c526e7

Revision 8c526e7 by Campbell Barton (master)
March 12, 2011, 16:06 (GMT)
library loading api.
this is not well suited to RNA so this is a native python api.

This uses:, link=False, relative=False)

however the return value needs to use pythons context manager, this means the library loading is confined to a block of code and python cant leave a half loaded library state.

eg, load a single scene we know the name of:
with as (data_from, data_to):
data_to.scenes = ["Scene"]

eg, load all scenes:
with as (data_from, data_to):
data_to.scenes = data_from.scenes

eg, load all objects starting with 'A'
with as (data_from, data_to):
data_to.objects = [name for name in data_from.objects if name.startswith("A")]

As you can see gives 2 objects like '', but containing lists of strings which can be moved from one into another.

Commit Details:

Full Hash: 8c526e79e31d40d56a6fecce9343c74bd9fe62d8
SVN Revision: 35499
Parent Commit: ce5c146
Lines Changed: +342, -18

By: Miika HämäläinenLast update: Nov-07-2014 14:18 MiikaHweb | 2003-2021