Hello, I have a pretty heavy scene and I was thinking about linking optimization. How much more resources a duplicate requires than a link?
And is there a way to replace all duplis with links?
It depends of how dense the mesh is, I suppose.
Select all duplicates and then last select the object you want to link and press CTRL+L and choose object data.
1 Like
I do that often and wrote a script that links objects based on their names. You select objects like object_a, object_b etc. and it will look for object_a.001, object_b.001 and link them to selected. Just run it from text editor in blender.
import bpy
C = bpy.context
unselectable = []
for lib in C.selected_objects:
bpy.ops.object.select_all(action='DESELECT')
counter = 0
bpy.context.view_layer.objects.active = lib
for o in bpy.data.objects:
try:
if lib.name in o.name:
o.select_set(True)
counter += 1
except RuntimeError:
unselectable.append(o)
bpy.ops.object.make_links_data(type='OBDATA')
print("Linked", lib.name, "with", counter, "objects.")
for uo in unselectable:
print(uo.name, "is unselectable.")
1 Like
Thanks guys, I saved your code.