How to replace meshes for every obj in a list?

I have this simple script and Ive stuck at… how to actualy change mesh for certain obj.

import bpy

list = [‘obj1’, ‘obj2’, ‘obj3’]

for obj in list:
mesh = bpy.data.meshes[‘meshToReplace’]

PS I know there is Ctrl+L but what when “restrict selection” is used.

This effectively creates instances out of all the objects in the list.


list = ['obj1','obj2','obj3']
me = bpy.data.meshes.get("meshToReplace")
if me != None:
    for obj in list:
        obj.data = me

tnx buddy :slight_smile: