Command to append an mesh object from another file

Scripting in Blender with Python, and working on the API

Moderators: jesterKing, stiv

Posts: 7
Joined: Wed Sep 06, 2006 4:36 pm

Command to append an mesh object from another file

Postby strattonbrazil » Thu Jul 26, 2012 5:02 am

I'm new to blender python and was going to use the info panel to grab command output to put in my scripts. I went through the manual workflow of selecting "Append", selecitng the blender file, selecting the object, and appending it, but I didn't see any output in the info panel.

Is it possible to append an object from another blender file programmatically?


Posts: 894
Joined: Sun Apr 05, 2009 7:42 pm
Location: Germany

Postby CoDEmanX » Thu Jul 26, 2012 11:44 am

Let's say you wanna append the Object "Monkey" (which is a monkey mesh) to current .blend and that Monkey object in in file D:\monkey.blend

Code: Select all

bpy.ops.wm.link_append(directory="D:\\monkey.blend\\Object\\", link=False, filename="Monkey")

dir has to be X:\\path\\filename.ext\\type\\ and filename the id name (in case of type Object, it refers to an object id)
I'm sitting, waiting, wishing, building Blender in superstition...

Return to “Python”

Who is online

Users browsing this forum: No registered users and 1 guest