Fix #105096: Material Utilities: Clean Material Slots fails to remove unused slots #105098

Merged
Thomas Barlow merged 2 commits from Mysteryem/blender-addons:fix_105096_material_utilities_clean_slots into main 2024-01-11 12:23:50 +01:00
2 changed files with 2 additions and 2 deletions

View File

@ -20,7 +20,7 @@
bl_info = { bl_info = {
"name": "Material Utilities", "name": "Material Utilities",
"author": "MichaleW, ChrisHinde", "author": "MichaleW, ChrisHinde",
"version": (2, 2, 1), "version": (2, 2, 2),
"blender": (3, 0, 0), "blender": (3, 0, 0),
"location": "View3D > Shift + Q key", "location": "View3D > Shift + Q key",
"description": "Menu of material tools (assign, select..) in the 3D View", "description": "Menu of material tools (assign, select..) in the 3D View",

View File

@ -16,7 +16,7 @@ def mu_assign_material_slots(object, material_list):
active_object = bpy.context.active_object active_object = bpy.context.active_object
bpy.context.view_layer.objects.active = object bpy.context.view_layer.objects.active = object
for s in object.material_slots: for _ in range(len(object.material_slots)):
bpy.ops.object.material_slot_remove() bpy.ops.object.material_slot_remove()
# re-add them and assign material # re-add them and assign material