From b7b7d3a93706cd1e9edea3ca9508fdf177f389e0 Mon Sep 17 00:00:00 2001 From: Sean Kim Date: Tue, 12 Mar 2024 21:34:43 +0100 Subject: [PATCH] Fix #119396: Add toggle for texture paint mask icon This PR adjusts the behavior of the Texture Paint mask icon to behave similarly to the automasking icon in Sculpt mode. This behavior was missed in the original task: #102585 Pull Request: https://projects.blender.org/blender/blender/pulls/119399 --- scripts/startup/bl_ui/space_view3d.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/startup/bl_ui/space_view3d.py b/scripts/startup/bl_ui/space_view3d.py index 4b33b02e505..201adc5bd80 100644 --- a/scripts/startup/bl_ui/space_view3d.py +++ b/scripts/startup/bl_ui/space_view3d.py @@ -995,7 +995,7 @@ class VIEW3D_HT_header(Header): row = layout.row() row.ui_units_x = 9 row.popover(panel="VIEW3D_PT_slots_projectpaint", icon=icon) - row.popover(panel="VIEW3D_PT_mask", icon='MOD_MASK', text="") + row.popover(panel="VIEW3D_PT_mask", icon=VIEW3D_HT_header._texture_mask_icon(tool_settings.image_paint), text="") else: # Transform settings depending on tool header visibility VIEW3D_HT_header.draw_xform_template(layout, context) @@ -1103,6 +1103,11 @@ class VIEW3D_HT_header(Header): return "CLIPUV_DEHLT" if automask_enabled else "CLIPUV_HLT" + @staticmethod + def _texture_mask_icon(ipaint): + mask_enabled = ipaint.use_stencil_layer or ipaint.use_cavity + return "CLIPUV_DEHLT" if mask_enabled else "CLIPUV_HLT" + class VIEW3D_MT_editor_menus(Menu): bl_label = ""