Link a Material directly to an Object How is it possible to assign a material directly to an object using the python api, i.e. to use the same mesh linked to these object but a different material?
If I use the method obj.data.materials.new() the material is linked to the mesh and the obj.material_slots property is read only.
Has someone some advice how to accomplish that?
Thanks in advance.
To assign mat to the nth material slot on ob:
ob.material_slots[n].link = 'OBJECT'
ob.material_slots[n].material = mat

If you want to create new slots, I think you should do that on the Mesh (ob.data.materials.append(None)).