diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py index 8e82b07716c..071fbc5a147 100644 --- a/release/scripts/startup/bl_ui/space_image.py +++ b/release/scripts/startup/bl_ui/space_image.py @@ -1624,6 +1624,9 @@ class IMAGE_PT_overlay_image(Panel): layout.active = overlay.show_overlays layout.prop(uvedit, "show_metadata") + if sima.mode not in {'VIEW', 'PAINT'}: + layout.prop(overlay, "show_cursor") + # Grease Pencil properties class IMAGE_PT_annotation(AnnotationDataPanel, Panel): diff --git a/source/blender/draw/intern/draw_view.c b/source/blender/draw/intern/draw_view.c index 6fe0abf1adf..43526db38d2 100644 --- a/source/blender/draw/intern/draw_view.c +++ b/source/blender/draw/intern/draw_view.c @@ -229,7 +229,13 @@ static bool is_cursor_visible_2d(const DRWContextState *draw_ctx) case SI_MODE_UV: break; } - return (sima->overlay.flag & SI_OVERLAY_SHOW_OVERLAYS) != 0; + + if (G.moving & G_TRANSFORM_CURSOR) { + return true; + } + + return ((sima->overlay.flag & SI_OVERLAY_SHOW_OVERLAYS) != 0) && + ((sima->overlay.flag & SI_OVERLAY_HIDE_CURSOR) == 0); } /* -------------------------------------------------------------------- */ diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index 4e12f135242..58597ea5a39 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -1338,6 +1338,7 @@ typedef enum eSpaceImage_Flag { typedef enum eSpaceImageOverlay_Flag { SI_OVERLAY_SHOW_OVERLAYS = (1 << 0), + SI_OVERLAY_HIDE_CURSOR = (1 << 1), } eSpaceImageOverlay_Flag; /** Keep in sync with `STEPS_LEN` in `grid_frag.glsl`. */ diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 07521d39256..3599bddc937 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -5286,6 +5286,11 @@ static void rna_def_space_image_overlay(BlenderRNA *brna) prop = RNA_def_property(srna, "show_overlays", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "overlay.flag", SI_OVERLAY_SHOW_OVERLAYS); RNA_def_property_ui_text(prop, "Show Overlays", "Display overlays like UV Maps and Metadata"); + + prop = RNA_def_property(srna, "show_cursor", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "overlay.flag", SI_OVERLAY_HIDE_CURSOR); + RNA_def_property_ui_text(prop, "2D Cursor", "Display 2D Cursor Overlay"); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL); } static void rna_def_space_image(BlenderRNA *brna)