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
This commit is contained in:
23
doc/python_api/examples/bpy.types.BlendDataLibraries.load.py
Normal file
23
doc/python_api/examples/bpy.types.BlendDataLibraries.load.py
Normal file
@@ -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))
|
||||
Reference in New Issue
Block a user