Module LibData
[frames | no frames]

Module LibData

The bpy.libraries submodule.


This module provides access to objects stored in .blend files. With it scripts can append from Blender files to the current scene, like the File->Append menu entry in Blender does. It allows programmers to use .blend files as data files for their scripts.


This module is new and being considered as a replacement for the original Library module. Users should stay tuned to see which module is supported in the end.

       import bpy

       scn=                            # get current scene
       lib = bpy.libraries.load('//file.blend')          # open file.blend
       ob ='Cube')) # append Cube object from library to current scene
       mat ='Material')                # get a link to a material
       me = ob.getData(mesh=1)                           # get mesh data
       me.materials[0] = mat                             # assign linked material to mesh

LibData This class provides access to a specific type of library data.
Libraries This class provides a unified way to access and manipulate library types in Blender.

Function Summary
Library load(filename)
Select an existing .blend file for use as a library.

Function Details


Select an existing .blend file for use as a library. Unlike the Library module, multiple libraries can be defined at the same time.
filename - The filename of a Blender file. Filenames starting with "//" will be loaded relative to the blend file's location.
return a Library object.

Generated by Epydoc 2.1 on Thu May 10 20:31:59 2007