UI: Add "Remove All Materials" operator

Added a new operator `OBJECT_OT_material_slot_remove_all`
that removes all materials from the material slots of selected objects

This was inspired by a request proposal on RCS.

Pull Request: https://projects.blender.org/blender/blender/pulls/138402
This commit is contained in:
Eitan Traurig
2025-05-07 08:06:52 +02:00
committed by Pratik Borhade
parent 16c87b62e4
commit dd43ea4e9e
6 changed files with 70 additions and 0 deletions

View File

@@ -21,6 +21,7 @@ class MATERIAL_MT_context_menu(Menu):
layout.operator("object.material_slot_copy")
layout.operator("material.paste", icon='PASTEDOWN')
layout.operator("object.material_slot_remove_unused")
layout.operator("object.material_slot_remove_all")
class MATERIAL_UL_matslots(UIList):

View File

@@ -40,6 +40,7 @@ class GPENCIL_MT_material_context_menu(Menu):
).only_active = False
layout.operator("object.material_slot_remove_unused")
layout.operator("object.material_slot_remove_all")
class GPENCIL_UL_matslots(UIList):

View File

@@ -3351,6 +3351,7 @@ class VIEW3D_MT_object_cleanup(Menu):
layout.separator()
layout.operator("object.material_slot_remove_unused", text="Remove Unused Material Slots")
layout.operator("object.material_slot_remove_all", text="Remove All Materials")
class VIEW3D_MT_object_asset(Menu):