Making A Copy Of An Object Using The Blender Python API
Maybe your like
There are two ways to create a copy of an object in a scene:
- By calling the duplicate operator,
- By using the object’s “copy()” method.

Content on Patreon Creating a copy of an object using an operator
To make a copy of an object, just call the duplicate operator:
Python bpy.ops.object.duplicate(linked=False)| 1 | bpy.ops.object.duplicate(linked=False) |
The copied object must be selected and active.
The “linked” parameter specifies which copy to make: full (False) – the new object will be completely independent, or linked (True) – an instance of the object is created, the data of which refers to the data of the original object.
Creating a copy of an object using the “copy()” method
We can make a copy of an object without using operators.
By calling the “copy()” method on the original object, we will get its copy.
Python obj_copy = bpy.context.active_object.copy()| 1 | obj_copy=bpy.context.active_object.copy() |
Adding a copy of the object to the collection, we will see it in our scene.
Python bpy.context.collection.objects.link(obj_copy)| 1 | bpy.context.collection.objects.link(obj_copy) |
Using the “copy()” method, we will get an instance of an object. To make a full copy, we need to call the same “copy()” method for the object data and for the object animation data.
Python obj_copy.data = obj_copy.data.copy() if obj_copy.animation_data: obj_copy.animation_data.action = obj_copy.animation_data.action.copy()| 1234 | obj_copy.data=obj_copy.data.copy() ifobj_copy.animation_data:obj_copy.animation_data.action=obj_copy.animation_data.action.copy() |
Let’s define a function with the necessary calls:
Python def duplicate(obj, data=True, actions=True, collection=None): obj_copy = obj.copy() if data: obj_copy.data = obj_copy.data.copy() if actions and obj_copy.animation_data: obj_copy.animation_data.action = obj_copy.animation_data.action.copy() collection.objects.link(obj_copy) return obj_copy| 12345678 | defduplicate(obj,data=True,actions=True,collection=None):obj_copy=obj.copy()ifdata:obj_copy.data=obj_copy.data.copy()ifactions andobj_copy.animation_data:obj_copy.animation_data.action=obj_copy.animation_data.action.copy()collection.objects.link(obj_copy)returnobj_copy |
In the input parameters, we will pass:
- obj – the object to be copied
- data and actions – True or False to make a full copy or linked (instance)
- collection – the collection to place a copy of the object
Now, to create a copy of the currently active object, we just need to call the created function:
Python obj_copy = duplicate( obj=bpy.context.active_object, data=True, actions=True )| 12345 | obj_copy=duplicate(obj=bpy.context.active_object,data=True,actions=True) |
* .blend file with a code example for my Patreon subscribers
Tag » How To Duplicate Objects In Blender
-
The Different Methods Of Duplication In Blender And When To Use ...
-
Duplicate — Blender Manual
-
Duplication — Blender Manual
-
Duplicate Objects/Duplicate Linked – Blender Knowledgebase
-
2 Ways To Duplicate Objects In Blender 2.9 - YouTube
-
Duplicate Objects - Problem And Suggestion — Right-Click Select
-
Duplicate Parent With Child (other Way) — Right-Click Select
-
Duplication — Blender Manual - OpenHMD
-
Easiest Way Of Duplicating An Object Into Multiple Instances?
-
How Do You Duplicate And Flip Objects In Blender? - Reddit
-
Blender Duplicates The Material Each Time I Duplicate The Object
-
How To Duplicate An Object Along A Path In Blender - JAY VERSLUIS
-
Blender Duplicate Object – Difference Between Shift D, Alt D And ...
-
[Blender + Clip Studio] How To Duplicate A Group Of Symmetrical ...