Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen Bakker <jbakker>2020-10-07 17:29:15 +0300
committerJeroen Bakker <jeroen@blender.org>2020-10-07 18:15:17 +0300
commitafab33e0b97cc5e5278c3e8af5490b9583c3b95c (patch)
treead1aaabdfea64ca9b66ab7292e3f18452ed7acf3 /source/blender/makesrna
parentfc767502dc7dce4ff92d239abbcc49a68fe45e02 (diff)
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
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r--source/blender/makesrna/RNA_access.h1
-rw-r--r--source/blender/makesrna/intern/rna_space.c36
2 files changed, 37 insertions, 0 deletions
diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h
index cfd87f14d48..1c2db53b12c 100644
--- a/source/blender/makesrna/RNA_access.h
+++ b/source/blender/makesrna/RNA_access.h
@@ -585,6 +585,7 @@ extern StructRNA RNA_SpaceDopeSheetEditor;
extern StructRNA RNA_SpaceFileBrowser;
extern StructRNA RNA_SpaceGraphEditor;
extern StructRNA RNA_SpaceImageEditor;
+extern StructRNA RNA_SpaceImageOverlay;
extern StructRNA RNA_SpaceInfo;
extern StructRNA RNA_SpaceNLA;
extern StructRNA RNA_SpaceNodeEditor;
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index 0e5780012dd..2a4bc6bae06 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -1397,6 +1397,16 @@ static char *rna_View3DOverlay_path(PointerRNA *UNUSED(ptr))
/* Space Image Editor */
+static PointerRNA rna_SpaceImage_overlay_get(PointerRNA *ptr)
+{
+ return rna_pointer_inherit_refine(ptr, &RNA_SpaceImageOverlay, ptr->data);
+}
+
+static char *rna_SpaceImageOverlay_path(PointerRNA *UNUSED(ptr))
+{
+ return BLI_strdup("overlay");
+}
+
static char *rna_SpaceUVEditor_path(PointerRNA *UNUSED(ptr))
{
return BLI_strdup("uv_editor");
@@ -4512,6 +4522,23 @@ static void rna_def_space_properties(BlenderRNA *brna)
prop, NC_SPACE | ND_SPACE_PROPERTIES, "rna_SpaceProperties_search_filter_update");
}
+static void rna_def_space_image_overlay(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna = RNA_def_struct(brna, "SpaceImageOverlay", NULL);
+ RNA_def_struct_sdna(srna, "SpaceImage");
+ RNA_def_struct_nested(brna, srna, "SpaceImageEditor");
+ RNA_def_struct_path_func(srna, "rna_SpaceImageOverlay_path");
+ RNA_def_struct_ui_text(
+ srna, "Overlay Settings", "Settings for display of overlays in the UV/Image editor");
+
+ 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");
+}
+
static void rna_def_space_image(BlenderRNA *brna)
{
StructRNA *srna;
@@ -4675,7 +4702,16 @@ static void rna_def_space_image(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Show Mask Editor", "Show Mask editing related properties");
+ /* Overlays */
+ prop = RNA_def_property(srna, "overlay", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
+ RNA_def_property_struct_type(prop, "SpaceImageOverlay");
+ RNA_def_property_pointer_funcs(prop, "rna_SpaceImage_overlay_get", NULL, NULL, NULL);
+ RNA_def_property_ui_text(
+ prop, "Overlay Settings", "Settings for display of overlays in the UV/Image editor");
+
rna_def_space_image_uv(brna);
+ rna_def_space_image_overlay(brna);
/* mask */
rna_def_space_mask_info(srna, NC_SPACE | ND_SPACE_IMAGE, "rna_SpaceImageEditor_mask_set");