Way to delete material slot by part of name if are in object (2.8)

by Andrea   Last Updated April 16, 2019 02:15 AM

I try to find slot by part of name i try to delete with this example , that example remove my material but in material slot remains "Material".. not understand why. example:

 for object in bpy.data.objects:
     for m in bpy.data.materials:
        if "Part of name" in m.name:
            bpy.data.materials.remove(m)
Tags : python materials


Related Questions


Updated July 22, 2015 13:06 PM

Updated February 16, 2016 16:06 PM

Updated February 19, 2016 01:06 AM

Updated March 10, 2016 07:06 AM

Updated March 31, 2016 08:06 AM