Fix #138662: Image Editor View and Mask modes show UVs

With 24d08e0bae, the ability to view UVs
in the Image Editor was introduced in all modes, not just Texture Paint
and Edit Mode. This introduced a new flag that was enabled by default,
causing UVs to be displayed in any of the Image Editor modes.

While this is helpful for some workflows, it is unnecessarily
distracting for many usecases when using the Image and Mask modes of the
Image Editor. To remedy this, this PR adds various polls to ensure
that these are only shown in the Paint Mode of the Image Editor and the
UV Editor. Further thought should be put into the potential separation
between the different usecases of this editor, but that is out of scope
for now.

Pull Request: https://projects.blender.org/blender/blender/pulls/139563
This commit is contained in:
Sean Kim
2025-06-02 23:42:01 +02:00
committed by Sean Kim
parent 77b14f2dcb
commit 440c6c8b6f
3 changed files with 4 additions and 3 deletions

View File

@@ -1704,7 +1704,7 @@ class IMAGE_PT_overlay_uv_display(Panel):
@classmethod
def poll(cls, context):
sima = context.space_data
return (sima and not (sima.show_uvedit or sima.show_render))
return (sima and sima.mode in {'UV', 'PAINT'} and not (sima.show_uvedit or sima.show_render))
def draw(self, context):
layout = self.layout

View File

@@ -633,7 +633,8 @@ class MeshUVs : Overlay {
{
/* Wireframe UV Overlay. */
const bool show_wireframe_uv_edit = space_image->flag & SI_DRAWSHADOW;
const bool show_wireframe_uv_guide = !(space_image->flag & SI_NO_DRAW_UV_GUIDE);
const bool show_wireframe_uv_guide = !(space_image->flag & SI_NO_DRAW_UV_GUIDE) &&
space_mode_is_paint;
if (space_mode_is_uv && object_mode_is_edit) {
show_wireframe_ = show_wireframe_uv_edit;

View File

@@ -411,7 +411,7 @@ static void image_listener(const wmSpaceTypeListenerParams *params)
}
}
else if (ob) {
if (sima->lock && !(sima->flag & SI_NO_DRAW_UV_GUIDE)) {
if (sima->lock && !(sima->flag & SI_NO_DRAW_UV_GUIDE) && sima->mode == SI_MODE_PAINT) {
ED_area_tag_refresh(area);
ED_area_tag_redraw(area);
}