diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2013-09-05 19:09:10 +0400 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2013-09-05 19:09:10 +0400 |
commit | 5805a8d36d77404b868fe9f806261c3d0b5aed42 (patch) | |
tree | 82455ba8ea5f44ad86ba95e65148681803918202 /source/blender | |
parent | 4b1436b5252a6a006f0155e1bbb6c6b449b8f4e9 (diff) |
Expose theme color of shadow UVs (These include UVs that are drawn in
texture paint modes and as modified mesh uvs overlay) and UVs of other
objects.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/BKE_blender.h | 2 | ||||
-rw-r--r-- | source/blender/editors/include/UI_resources.h | 3 | ||||
-rw-r--r-- | source/blender/editors/interface/resources.c | 21 | ||||
-rw-r--r-- | source/blender/editors/uvedit/uvedit_draw.c | 6 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_userdef_types.h | 3 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_userdef.c | 12 |
6 files changed, 42 insertions, 5 deletions
diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h index 84e24df43e5..13fd4b2bab7 100644 --- a/source/blender/blenkernel/BKE_blender.h +++ b/source/blender/blenkernel/BKE_blender.h @@ -42,7 +42,7 @@ extern "C" { * and keep comment above the defines. * Use STRINGIFY() rather than defining with quotes */ #define BLENDER_VERSION 268 -#define BLENDER_SUBVERSION 2 +#define BLENDER_SUBVERSION 3 /* 262 was the last editmesh release but it has compatibility code for bmesh data */ #define BLENDER_MINVERSION 262 #define BLENDER_MINSUBVERSION 0 diff --git a/source/blender/editors/include/UI_resources.h b/source/blender/editors/include/UI_resources.h index 42e9d892871..0c8a39a6714 100644 --- a/source/blender/editors/include/UI_resources.h +++ b/source/blender/editors/include/UI_resources.h @@ -210,6 +210,9 @@ enum { TH_STITCH_PREVIEW_UNSTITCHABLE, TH_STITCH_PREVIEW_ACTIVE, + TH_UV_SHADOW, + TH_UV_OTHERS, + TH_FREESTYLE_EDGE_MARK, TH_FREESTYLE_FACE_MARK, diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index 1ef4d43c9f3..ace35f0276e 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -484,6 +484,14 @@ const unsigned char *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colo case TH_STITCH_PREVIEW_ACTIVE: cp = ts->preview_stitch_active; break; + + case TH_UV_OTHERS: + cp = ts->uv_others; + break; + case TH_UV_SHADOW: + cp = ts->uv_shadow; + break; + case TH_MARKER_OUTLINE: cp = ts->marker_outline; break; case TH_MARKER: @@ -918,6 +926,9 @@ void ui_theme_init_default(void) rgba_char_args_set_fl(btheme->tima.preview_stitch_unstitchable, 1.0, 0.0, 0.0, 1.0); rgba_char_args_set_fl(btheme->tima.preview_stitch_active, 0.886, 0.824, 0.765, 0.140); + rgba_char_args_test_set(btheme->tima.uv_others, 96, 96, 96, 255); + rgba_char_args_test_set(btheme->tima.uv_shadow, 112, 112, 112, 255); + /* space text */ btheme->text = btheme->tv3d; rgba_char_args_set(btheme->text.back, 153, 153, 153, 255); @@ -2205,7 +2216,15 @@ void init_userdef_do_versions(void) } /* NOTE!! from now on use U.versionfile and U.subversionfile */ - + + if (U.versionfile < 269 || (U.versionfile == 268 && U.subversionfile < 3)) { + bTheme *btheme; + for (btheme = U.themes.first; btheme; btheme = btheme->next) { + rgba_char_args_test_set(btheme->tima.uv_others, 96, 96, 96, 255); + rgba_char_args_test_set(btheme->tima.uv_shadow, 112, 112, 112, 255); + } + } + if (U.pixelsize == 0.0f) U.pixelsize = 1.0f; diff --git a/source/blender/editors/uvedit/uvedit_draw.c b/source/blender/editors/uvedit/uvedit_draw.c index 1ae1d57b77c..d20ef0e70e0 100644 --- a/source/blender/editors/uvedit/uvedit_draw.c +++ b/source/blender/editors/uvedit/uvedit_draw.c @@ -158,7 +158,7 @@ static int draw_uvs_dm_shadow(DerivedMesh *dm) /* draw shadow mesh - this is the mesh with the modifier applied */ if (dm && dm->drawUVEdges && CustomData_has_layer(&dm->loopData, CD_MLOOPUV)) { - glColor3ub(112, 112, 112); + UI_ThemeColor(TH_UV_SHADOW); dm->drawUVEdges(dm); return 1; } @@ -362,7 +362,7 @@ static void draw_uvs_other(Scene *scene, Object *obedit, Image *curimage) { Base *base; - glColor3ub(96, 96, 96); + UI_ThemeColor(TH_UV_OTHERS); for (base = scene->base.first; base; base = base->next) { Object *ob = base->object; @@ -404,7 +404,7 @@ static void draw_uvs_texpaint(SpaceImage *sima, Scene *scene, Object *ob) if (sima->flag & SI_DRAW_OTHER) draw_uvs_other(scene, ob, curimage); - glColor3ub(112, 112, 112); + UI_ThemeColor(TH_UV_SHADOW); if (me->mtpoly) { MPoly *mpoly = me->mpoly; diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index e0c5cd5608e..1621f7c6cb6 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -286,6 +286,9 @@ typedef struct ThemeSpace { char preview_stitch_unstitchable[4]; char preview_stitch_active[4]; + char uv_shadow[4]; + char uv_others[4]; + char match[4]; /* outliner - filter match */ char selected_highlight[4]; /* outliner - selected item */ diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index f34366a23c7..3b609b69374 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -2134,6 +2134,18 @@ static void rna_def_userdef_theme_space_image(BlenderRNA *brna) RNA_def_property_array(prop, 4); RNA_def_property_ui_text(prop, "Stitch preview active island", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop = RNA_def_property(srna, "uv_shadow", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_float_sdna(prop, NULL, "uv_shadow"); + RNA_def_property_array(prop, 4); + RNA_def_property_ui_text(prop, "Texture paint/Modifier UVs", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop = RNA_def_property(srna, "uv_others", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_float_sdna(prop, NULL, "uv_others"); + RNA_def_property_array(prop, 4); + RNA_def_property_ui_text(prop, "Other Object UVs", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); } static void rna_def_userdef_theme_space_seq(BlenderRNA *brna) |