Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def clean_mat_slots(self):
- bpy.ops.object.select_all(action='DESELECT')
- for ob in bpy.data.objects:
- if ob.type != 'MESH':
- continue
- ob.select_set(state=True)
- bpy.context.view_layer.objects.active = ob
- # Delete all material slots in bounds object
- for i in range(len(ob.material_slots)):
- print("mat slot:", i)
- ob.active_material_index = i - 1
- bpy.ops.object.material_slot_remove()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement