Blender 2.8 Unlinking materials from an object

I have a file with about 50 objects all as 1 object, which I have split up into individual objects. This has led to all objects having all materials linked to them. How do I make it so only used materials are linked to the appropriate objects? Or even a way once an object is separated to auto remove all unused materials.

In the Material Properties panel of the Properties Editor, right next to the UIList with the materials slots, thereā€™s a ā€˜Material Specialsā€™ dropdown (just a dropdown icon) with Remove_Unsused_Slots operator.

If you have lots of objects, you might want to use python for looping through all (selected) objectsā€¦

vl_objs = bpy.context.view_layer.objects
for obj in vl_objs.selected:
    if obj.type == 'MESH':
        vl_objs.active = obj
        bpy.ops.object.material_slot_remove_unused()

If you Separate by Materials, unused slots will be automatically removed.

1 Like

Thank you very much. Taking me a while to get used to 2.8. Will try this later.

Cannot find ā€˜Material Specialsā€™

I donā€™t have that, the drop down there only states copy material, copy material to selected and paste material

You need a blender version after this commit (from 31th July).
You can use the latest night build.

What about official release?

Official release will be 2.81.
I think it will come out next week, If you want to wait (if not, you can still use the nightly build).

Thanks you have been very helpful