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:
authorCampbell Barton <ideasman42@gmail.com>2018-12-05 06:35:45 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-12-05 06:38:58 +0300
commit5c8f1053b5f0f65168497fe5989cbc1b5cbba1ea (patch)
treeca29583fbe90a5315403a2192f11ef2d140f4be7 /source/blender/makesrna/intern/rna_space.c
parentd59c4c9d61a1634f75369a02ff7f381612988c9f (diff)
UI: split UV editor out of the image space
Diffstat (limited to 'source/blender/makesrna/intern/rna_space.c')
-rw-r--r--source/blender/makesrna/intern/rna_space.c46
1 files changed, 40 insertions, 6 deletions
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index e8cda30a511..c2065548836 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -167,14 +167,42 @@ const EnumPropertyItem rna_enum_space_action_mode_items[] = {
#undef SACT_ITEM_MASK
#undef SACT_ITEM_CACHEFILE
+
+#define SI_ITEM_VIEW(name, icon) \
+ {SI_MODE_VIEW, "VIEW", icon, name, "View the image"}
+#define SI_ITEM_UV \
+ {SI_MODE_UV, "UV", ICON_GROUP_UVS, "UV Edit", "UV edit in mesh editmode"}
+#define SI_ITEM_PAINT \
+ {SI_MODE_PAINT, "PAINT", ICON_TPAINT_HLT, "Paint", "2D image painting mode"}
+#define SI_ITEM_MASK \
+ {SI_MODE_MASK, "MASK", ICON_MOD_MASK, "Mask", "Mask editing"}
+
+static const EnumPropertyItem rna_enum_space_image_mode_all_items[] = {
+ SI_ITEM_VIEW("View", ICON_FILE_IMAGE),
+ SI_ITEM_UV,
+ SI_ITEM_PAINT,
+ SI_ITEM_MASK,
+ {0, NULL, 0, NULL, NULL}
+};
+
+static const EnumPropertyItem rna_enum_space_image_mode_ui_items[] = {
+ SI_ITEM_VIEW("View", ICON_FILE_IMAGE),
+ SI_ITEM_PAINT,
+ SI_ITEM_MASK,
+ {0, NULL, 0, NULL, NULL}
+};
+
const EnumPropertyItem rna_enum_space_image_mode_items[] = {
- {SI_MODE_VIEW, "VIEW", ICON_FILE_IMAGE, "View", "View the image"},
- {SI_MODE_UV, "UV", ICON_GROUP_UVS, "UV Edit", "UV edit in mesh editmode"},
- {SI_MODE_PAINT, "PAINT", ICON_TPAINT_HLT, "Paint", "2D image painting mode"},
- {SI_MODE_MASK, "MASK", ICON_MOD_MASK, "Mask", "Mask editing"},
+ SI_ITEM_VIEW("Image Editor", ICON_IMAGE),
+ SI_ITEM_UV,
{0, NULL, 0, NULL, NULL}
};
+#undef SI_ITEM_VIEW
+#undef SI_ITEM_UV
+#undef SI_ITEM_PAINT
+#undef SI_ITEM_MASK
+
#define V3D_S3D_CAMERA_LEFT {STEREO_LEFT_ID, "LEFT", ICON_RESTRICT_RENDER_OFF, "Left", ""},
#define V3D_S3D_CAMERA_RIGHT {STEREO_RIGHT_ID, "RIGHT", ICON_RESTRICT_RENDER_OFF, "Right", ""},
#define V3D_S3D_CAMERA_S3D {STEREO_3D_ID, "S3D", ICON_CAMERA_STEREO, "3D", ""},
@@ -3539,10 +3567,16 @@ static void rna_def_space_image(BlenderRNA *brna)
RNA_def_property_pointer_funcs(prop, "rna_SpaceImageEditor_uvedit_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "UV Editor", "UV editor settings");
- /* mode */
+ /* mode (hidden in the UI, see 'ui_mode') */
prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "mode");
- RNA_def_property_enum_items(prop, rna_enum_space_image_mode_items);
+ RNA_def_property_enum_items(prop, rna_enum_space_image_mode_all_items);
+ RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed");
+ RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, "rna_SpaceImageEditor_mode_update");
+
+ prop = RNA_def_property(srna, "ui_mode", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "mode");
+ RNA_def_property_enum_items(prop, rna_enum_space_image_mode_ui_items);
RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed");
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, "rna_SpaceImageEditor_mode_update");