Append an object

Hi!
I’d like to append an object into my scene. I have been reading about this:

bpy.ops.wm.link_append(<i>filepath=""</i>, <i>directory=""</i>, <i>filename=""</i>, <i>files=None</i>, <i>filter_blender=True</i>, <i>filter_image=False</i>, <i>filter_movie=False</i>, <i>filter_python=False</i>, <i>filter_font=False</i>, <i>filter_sound=False</i>, <i>filter_text=False</i>, <i>filter_btx=False</i>, <i>filter_collada=False</i>, <i>filter_folder=True</i>, <i>filemode=1</i>, <i>relative_path=True</i>, <i>display_type='FILE_DEFAULTDISPLAY'</i>, <i>link=True</i>, <i>autoselect=True</i>, <i>active_layer=True</i>, <i>instance_groups=True</i>)

but I don’t understand yet how to use it. Some help?

Thank you in advance!
Ana.

The API has changed a bit since recent versions. There is now two separates command to append (bpy.ops.wm.append()) or link (bpy.ops.wm.link()) datablocks. bpy.ops.wm.link_append() is not valid anymore.

To append an object, you can use something like:
bpy.ops.wm.append(directory="//your_directory//your_file.blend/Object/", filepath=“your_file.blend”, filename=“your_object”)

Hi!

I’m working with Blender 2.69 and I can’t use bpy.ops.wm.append():

File "/usr/share/blender/scripts/modules/bpy/ops.py", line 188, in __call__
    ret = op_call(self.idname_py(), None, kw)
AttributeError: Calling operator "bpy.ops.wm.append" error, could not be found

When I use bpy.ops.wm.link_append() with the same parameters:

<b>directory="//your_directory//your_file.blend/Object/", filepath="your_file.blend", filename="your_object"</b>

my script runs without errors. But, even so, when I open the scene with Blender the object that I have appended doesn’t appear. :no:

Thanks in advance!
Ana.

Why are there // twice in the directory argument?

Ok, the problem was the object. I was writing wrong the name (although no errors were displayed). SOLVED!
Thanks, VincentG.:wink: