From afab33e0b97cc5e5278c3e8af5490b9583c3b95c Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Wed, 7 Oct 2020 16:29:15 +0200 Subject: UV/Image Editor: Overlay Popover The overlay options in the image/uv editor is hidden in side panels and menus. Sometimes this panel is even hidden, while still useful. The goal of this task is to introduce an overlay pop-over just like the overlay-popover of the 3d viewport. Popover has * UV Stretching (only available in the UV mode, when active object mode is a mesh and in OB_EDIT mode) * Display As (only available in the UV mode, when active object mode is a mesh and in OB_EDIT mode) * Show Modified (only available in the UV mode, when active object mode is a mesh and in OB_EDIT mode) * Show UV Edges (including opacity slider; available UV, View, Paint, when active object mode is a mesh and in OB_EDIT mode) * Udim tiles when no image is available. Like the 3d viewport, there will be a editor toggle to enable/disable the overlays For compatibility reasons the RNA properties are added to both the `SpaceImage.uv_editor` amd `SpaceImage.overlay`. On DNA level they are still stored in the SpaceImage. only new properties are added to the SpaceImageOverlay struct. During the next major release we could remove these options from `SpaceImage.uv_editor`. This should be noted in the Python section of release notes. Reviewed By: Julian Eisel, Pablo Vazquez Differential Revision: https://developer.blender.org/D8890 --- source/blender/makesdna/DNA_space_types.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'source/blender/makesdna/DNA_space_types.h') diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index 867da1bcb82..9d9b41a1f81 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -1037,6 +1037,12 @@ enum { * \{ */ /* Image/UV Editor */ + +typedef struct SpaceImageOverlay { + int flag; + char _pad[4]; +} SpaceImageOverlay; + typedef struct SpaceImage { SpaceLink *next, *prev; /** Storage of regions for inactive spaces. */ @@ -1096,6 +1102,7 @@ typedef struct SpaceImage { int tile_grid_shape[2]; MaskSpaceInfo mask_info; + SpaceImageOverlay overlay; } SpaceImage; /* SpaceImage.dt_uv */ @@ -1158,7 +1165,7 @@ typedef enum eSpaceImage_Flag { SI_PREVSPACE = (1 << 15), SI_FULLWINDOW = (1 << 16), - SI_FLAG_UNUSED_17 = (1 << 17), /* cleared */ + SI_FLAG_UNUSED_17 = (1 << 17), SI_FLAG_UNUSED_18 = (1 << 18), /* cleared */ /** @@ -1181,6 +1188,10 @@ typedef enum eSpaceImage_Flag { SI_SHOW_B = (1 << 29), } eSpaceImage_Flag; +typedef enum eSpaceImageOverlay_Flag { + SI_OVERLAY_SHOW_OVERLAYS = (1 << 0), +} eSpaceImageOverlay_Flag; + /** \} */ /* -------------------------------------------------------------------- */ -- cgit v1.2.3