From aee5f0e20f1d2d52306e9cdf134a54aa71d11527 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 14 Mar 2011 03:34:57 +0000 Subject: patch [#26495] Adjustable outline width for selected objects --- source/blender/editors/include/UI_resources.h | 1 + source/blender/editors/interface/resources.c | 10 ++++++++++ source/blender/editors/space_view3d/drawobject.c | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) (limited to 'source/blender/editors') diff --git a/source/blender/editors/include/UI_resources.h b/source/blender/editors/include/UI_resources.h index 04cf8cd35bf..2311aafbb17 100644 --- a/source/blender/editors/include/UI_resources.h +++ b/source/blender/editors/include/UI_resources.h @@ -161,6 +161,7 @@ enum { TH_VERTEX, TH_VERTEX_SELECT, TH_VERTEX_SIZE, + TH_OUTLINE_WIDTH, TH_EDGE, TH_EDGE_SELECT, TH_EDGE_SEAM, diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index 18f2d778190..81e093c07ff 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -265,6 +265,8 @@ const unsigned char *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colo cp= ts->vertex_select; break; case TH_VERTEX_SIZE: cp= &ts->vertex_size; break; + case TH_OUTLINE_WIDTH: + cp= &ts->outline_width; break; case TH_EDGE: cp= ts->edge; break; case TH_EDGE_SELECT: @@ -513,6 +515,7 @@ void ui_theme_init_default(void) SETCOL(btheme->tv3d.vertex, 0, 0, 0, 255); SETCOL(btheme->tv3d.vertex_select, 255, 133, 0, 255); btheme->tv3d.vertex_size= 3; + btheme->tv3d.outline_width= 1; SETCOL(btheme->tv3d.edge, 0x0, 0x0, 0x0, 255); SETCOL(btheme->tv3d.edge_select, 255, 160, 0, 255); SETCOL(btheme->tv3d.edge_seam, 219, 37, 18, 255); @@ -1512,6 +1515,13 @@ void init_userdef_do_versions(void) } } + if (bmain->versionfile < 256 || (bmain->versionfile == 256 && bmain->subversionfile < 4)) { + bTheme *btheme; + for(btheme= U.themes.first; btheme; btheme= btheme->next) { + if((btheme->tv3d.outline_width) == 0) btheme->tv3d.outline_width= 1; + } + } + if (bmain->versionfile < 257) { /* clear "AUTOKEY_FLAG_ONLYKEYINGSET" flag from userprefs, so that it doesn't linger around from old configs like a ghost */ U.autokey_flag &= ~AUTOKEY_FLAG_ONLYKEYINGSET; diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 4979c3c2a2a..cd37e0315b3 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -2455,7 +2455,7 @@ static void draw_mesh_object_outline(View3D *v3d, Object *ob, DerivedMesh *dm) { if(v3d->transp==0) { // not when we draw the transparent pass - glLineWidth(2.0); + glLineWidth(UI_GetThemeValuef(TH_OUTLINE_WIDTH) * 2.0); glDepthMask(0); /* if transparent, we cannot draw the edges for solid select... edges have no material info. -- cgit v1.2.3