Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-03-14 13:31:50 +0300
committerCampbell Barton <ideasman42@gmail.com>2011-03-14 13:31:50 +0300
commit2d1ef275f2299c71dade74743cdca0c771648333 (patch)
treeff5aecce30dde5a39531755fd54b720d44686114 /doc/python_api/examples
parent80d1bb5fcd5195859a6d622179073348f5034308 (diff)
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
Diffstat (limited to 'doc/python_api/examples')
-rw-r--r--doc/python_api/examples/bpy.types.BlendDataLibraries.load.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/doc/python_api/examples/bpy.types.BlendDataLibraries.load.py b/doc/python_api/examples/bpy.types.BlendDataLibraries.load.py
new file mode 100644
index 00000000000..43e6ac90ae7
--- /dev/null
+++ b/doc/python_api/examples/bpy.types.BlendDataLibraries.load.py
@@ -0,0 +1,23 @@
+import bpy
+
+filepath = "//link_library.blend"
+
+# load a single scene we know the name of.
+with bpy.data.libraries.load(filepath) as (data_from, data_to):
+ data_to.scenes = ["Scene"]
+
+
+# load all meshes
+with bpy.data.libraries.load(filepath) as (data_from, data_to):
+ data_to.meshes = data_from.meshes
+
+
+# link all objects starting with 'A'
+with bpy.data.libraries.load(filepath, link=True) as (data_from, data_to):
+ data_to.objects = [name for name in data_from.objects if name.startswith("A")]
+
+
+# append everything
+with bpy.data.libraries.load(filepath) as (data_from, data_to):
+ for attr in dir(data_to):
+ setattr(data_to, attr, getattr(data_from, attr))