1
$\begingroup$

Is there a way to copy/duplicate/link objects to multiple locations at once? For instance I have several boxes around the scene and I want to copy/link/duplicate a sphere to the location of each box... Is this even possible?

$\endgroup$
2
  • $\begingroup$ have you tried linked duplications or instance groups? $\endgroup$
    – moonboots
    Commented Oct 5, 2018 at 7:13
  • $\begingroup$ Create a plane with vertices at each location you want the object to appear then use Duliverts. You can delete the plane afterwards. Otherwise I think the only solution is Python scripting. $\endgroup$
    – rob
    Commented Oct 5, 2018 at 7:29

2 Answers 2

3
$\begingroup$

I love Python scripting, however this can easily be done without it. Here is one quick way:

  1. Select all the objects you want to use as "position points".
  2. Duplicate them (Shift+D).
  3. Add the object you wish to be spread out to those location points to the selection (Shift+LMB). It should be active now.
  4. Link their data (Ctrl+L) as Link Object Data.

That's it. The object will inherit the position, orientation, and scale. You could also apply those transforms (Ctrl+A > All Transforms) before linking the data.

enter image description here

$\endgroup$
2
  • $\begingroup$ Cool! The only difficulty could, perhaps, be in selecting all the objects initially, if they are distributed widely or overlapping (... is it nitpicking? :) The drawback of python method is: it has to make selection based on some criteria, which would be necessarily arbitrary (like poly count in the python script) and break under some conditions. $\endgroup$ Commented Oct 6, 2018 at 14:52
  • $\begingroup$ Well.. I would assume a selection method should be already thought trough while placing them. Maybe they are grouped, or share same material or any other trait in shift+g and shift+l menus. Another thing is - their origin point loaction in relation with their meshes should match. If they have transforms applied, that will not work obviously. $\endgroup$ Commented Oct 6, 2018 at 16:42
0
$\begingroup$

This can be done with a relatively straight forward script.

If you don't mind a script based solution, you can select the two objects (the one to be duplicated last) and execute the following script. Here the objects are considered of the same type based on the polygon count.

import bpy

if(len(bpy.context.selected_objects) != 2):
    print('Select exactly two objects, first: the object of the type whose location is to be copied and second: the object to be duplicated')

else:
    destObj = bpy.context.active_object
    srcObj = [o for o in bpy.context.selected_objects if o.name != destObj.name][0]

    srcObj.select = False

    srcPolyLen = len(srcObj.data.polygons)
    for i, obj in enumerate(bpy.data.objects):
        if(len(obj.data.polygons) == srcPolyLen):
            bpy.ops.object.duplicate_move(OBJECT_OT_duplicate={"linked":False, "mode":'TRANSLATION'}, TRANSFORM_OT_translate={"value":(-0, 0, 0), "constraint_axis":(False, False, False)})            
            bpy.context.object.location = obj.location
            bpy.context.object.select = False
            bpy.context.scene.objects.active = destObj
            destObj.select = True
    srcObj.select = True

duplicate objects

$\endgroup$

You must log in to answer this question.

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