# Import group from external blend file

I have a .blend file that has a house group in it:

I'd like my script to be able to extract the house group from that file, then make duplicates of it in the current scene. I want to be able to position the duplicates etc.

The closest I could find is getting the meshes in the .blend file, here: http://www.blender.org/api/blender_python_api_2_72_release/bpy.types.BlendDataLibraries.html

filepath = dir + "/somewhere/myHouseModel.blend";

data_to.meshes = data_from.meshes
for mesh in data_to.meshes:
if mesh is not None:
print("Mesh name: %s" % (mesh));
...


I suppose I could do something to just extract the meshes and work with that, but it would be nicer to properly link to the group. This is how I had it working manually in a standalone blend scene, so I'd like to mimic it via my python script.

Thank you for any help

• – David Sep 8 '15 at 1:15
• – p2or Sep 8 '15 at 10:39

with bpy.data.libraries.load("/home/batfinger/3DModels/mouth.blend") as (df, dt):