How to duplicate an object along with its parent/children relationships using Python in Blender 2.9x I have the model of a vehicle body with its wheels and empty coordinates systems at the wheels which are all parented sequentially to the vehicle body. I would like to ask how it is possible to duplicate all the objects and the subsequent relationships using the Python API. In the following image, you can see the relationships that I described; I would like to duplicate this.
I used to bpy.ops.object.duplicate to duplicate the selected objects coming from the select_set() method.
In this way, the underlying parent/children relationships are maintained during the duplication.