Previous Thread  Next Thread

chat icon Command to append an mesh object from another file

strattonbrazil

Posted: Thu Jul 26, 2012 4:02 am
Joined: 06 Sep 2006
Posts: 7
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?

Thanks.
Reply with quote


CoDEmanX

Posted: Thu Jul 26, 2012 10:44 am
Joined: 05 Apr 2009
Posts: 680
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:
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...
Reply with quote


 
Jump to:  
Powered by phpBB © 2001, 2005 phpBB Group