Commit Graph

9 Commits

Author SHA1 Message Date
eabb444106 minor cleanup: make functions static, use NULL for pointer comparisons,
also fixed a possible bug assigning incorrect DPX function types to
imbuf.
2011-05-10 13:11:36 +00:00
f86565c90e whitespace edits for bpy api, split some really long lines. 2011-04-30 13:58:31 +00:00
cadc1218c8 C, style changes (mostly white space edits), no functional change. 2011-03-19 11:12:48 +00:00
fe529d43fe fix for building on some configurations. 2011-03-15 01:48:01 +00:00
2d1ef275f2 bpy.types.libraries.load sphinx doc & examples (doc system needed some updates).
http://www.blender.org/documentation/blender_python_api_2_56_3/bpy.types.BlendDataLibraries.html#bpy.types.BlendDataLibraries.load
2011-03-14 10:31:50 +00:00
9ec2dfe0df add dir() function for library objects, also was missing call to clear temp flag on exceptions. 2011-03-14 01:00:41 +00:00
25a2eb4675 py/library api: raise an error if a requested member isn't found. 2011-03-13 01:15:14 +00:00
60a2994435 SVN maintenance. 2011-03-13 00:26:46 +00:00
8c526e79e3 library loading api.
this is not well suited to RNA so this is a native python api.

This uses:
  bpy.data.libraries.load(filepath, 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 bpy.data.libraries.load(filepath) as (data_from, data_to):
      data_to.scenes = ["Scene"]


eg, load all scenes:
  with bpy.data.libraries.load(filepath) as (data_from, data_to):
      data_to.scenes = data_from.scenes


eg, load all objects starting with 'A'
  with bpy.data.libraries.load(filepath) 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 'bpy.data', but containing lists of strings which can be moved from one into another.
2011-03-12 16:06:37 +00:00