I try to copy my model and append it as child.

enter image description here Before

enter image description here After

When I try to duplicate by bpy.ops.object.duplicate().

It will return {'FINISHED'} which is not useful for accessing it!

I can't put any operation when the item id is unknown!


2 Answers 2


If you need the object for further operations it's best to do the duplication without the operator.

data_copy = bpy.data.objects["Cube"].data.copy()
obj_copy = bpy.data.objects["Cube"].copy()
obj_copy.data = data_copy
obj_copy.parent = bpy.data.objects["Cube"]

It is best to do it without the operator like in the answer by rjg, however after the operator is run the duplicated object becomes the active object, so it's bpy.context.object and if you are duplicating a few objects, all the duplicates become selected so they are all in bpy.context.selected_objects .


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .