[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [57299] trunk/blender/source/blender: add editmode wire color,
Campbell Barton
ideasman42 at gmail.com
Sat Jun 8 23:58:00 CEST 2013
Revision: 57299
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=57299
Author: campbellbarton
Date: 2013-06-08 21:58:00 +0000 (Sat, 08 Jun 2013)
Log Message:
-----------
add editmode wire color,
also changed lattice to use this, it used a hard-coded green color which was hard to see over the default background.
Modified Paths:
--------------
trunk/blender/source/blender/editors/include/UI_resources.h
trunk/blender/source/blender/editors/interface/resources.c
trunk/blender/source/blender/editors/space_view3d/drawarmature.c
trunk/blender/source/blender/editors/space_view3d/drawobject.c
trunk/blender/source/blender/makesdna/DNA_userdef_types.h
trunk/blender/source/blender/makesrna/intern/rna_userdef.c
Modified: trunk/blender/source/blender/editors/include/UI_resources.h
===================================================================
--- trunk/blender/source/blender/editors/include/UI_resources.h 2013-06-08 21:48:01 UTC (rev 57298)
+++ trunk/blender/source/blender/editors/include/UI_resources.h 2013-06-08 21:58:00 UTC (rev 57299)
@@ -80,6 +80,7 @@
TH_GRID,
TH_WIRE,
+ TH_WIRE_EDIT,
TH_SELECT,
TH_ACTIVE,
TH_GROUP,
Modified: trunk/blender/source/blender/editors/interface/resources.c
===================================================================
--- trunk/blender/source/blender/editors/interface/resources.c 2013-06-08 21:48:01 UTC (rev 57298)
+++ trunk/blender/source/blender/editors/interface/resources.c 2013-06-08 21:58:00 UTC (rev 57299)
@@ -257,6 +257,8 @@
cp = ts->grid; break;
case TH_WIRE:
cp = ts->wire; break;
+ case TH_WIRE_EDIT:
+ cp = ts->wire_edit; break;
case TH_LAMP:
cp = ts->lamp; break;
case TH_SPEAKER:
@@ -736,6 +738,7 @@
rgba_char_args_set_fl(btheme->tv3d.grid, 0.251, 0.251, 0.251, 1.0);
rgba_char_args_set(btheme->tv3d.wire, 0x0, 0x0, 0x0, 255);
+ rgba_char_args_set(btheme->tv3d.wire_edit, 0x0, 0x0, 0x0, 255);
rgba_char_args_set(btheme->tv3d.lamp, 0, 0, 0, 40);
rgba_char_args_set(btheme->tv3d.speaker, 0, 0, 0, 255);
rgba_char_args_set(btheme->tv3d.camera, 0, 0, 0, 255);
@@ -2047,6 +2050,10 @@
rgba_char_args_set(btheme->tv3d.freestyle_edge_mark, 0x7f, 0xff, 0x7f, 255);
rgba_char_args_set(btheme->tv3d.freestyle_face_mark, 0x7f, 0xff, 0x7f, 51);
}
+
+ if (btheme->tv3d.wire_edit[3] == 0) {
+ rgba_char_args_set(btheme->tv3d.wire_edit, 0x0, 0x0, 0x0, 255);
+ }
}
}
Modified: trunk/blender/source/blender/editors/space_view3d/drawarmature.c
===================================================================
--- trunk/blender/source/blender/editors/space_view3d/drawarmature.c 2013-06-08 21:48:01 UTC (rev 57298)
+++ trunk/blender/source/blender/editors/space_view3d/drawarmature.c 2013-06-08 21:58:00 UTC (rev 57299)
@@ -302,13 +302,13 @@
UI_ThemeColor(TH_EDGE_SELECT);
}
else if (boneflag & BONE_DRAW_ACTIVE) {
- UI_ThemeColorBlend(TH_WIRE, TH_EDGE_SELECT, 0.15f); /* unselected active */
+ UI_ThemeColorBlend(TH_WIRE_EDIT, TH_EDGE_SELECT, 0.15f); /* unselected active */
}
else if (boneflag & BONE_SELECTED) {
UI_ThemeColorShade(TH_EDGE_SELECT, -20);
}
else {
- UI_ThemeColor(TH_WIRE);
+ UI_ThemeColor(TH_WIRE_EDIT);
}
}
@@ -817,7 +817,7 @@
/* base */
if (armflag & ARM_EDITMODE) {
if (boneflag & BONE_SELECTED) UI_ThemeColor(TH_SELECT);
- else UI_ThemeColor(TH_WIRE);
+ else UI_ThemeColor(TH_WIRE_EDIT);
}
sub_v3_v3v3(dirvec, tailvec, headvec);
@@ -1014,7 +1014,7 @@
if (armflag & ARM_POSEMODE)
set_pchan_glColor(PCHAN_COLOR_NORMAL, boneflag, constflag);
else if (armflag & ARM_EDITMODE) {
- UI_ThemeColor(TH_WIRE);
+ UI_ThemeColor(TH_WIRE_EDIT);
}
/* Draw root point if we are not connected */
@@ -2212,7 +2212,7 @@
/* offset to parent */
if (eBone->parent) {
- UI_ThemeColor(TH_WIRE);
+ UI_ThemeColor(TH_WIRE_EDIT);
glLoadName(-1); /* -1 here is OK! */
setlinestyle(3);
Modified: trunk/blender/source/blender/editors/space_view3d/drawobject.c
===================================================================
--- trunk/blender/source/blender/editors/space_view3d/drawobject.c 2013-06-08 21:48:01 UTC (rev 57298)
+++ trunk/blender/source/blender/editors/space_view3d/drawobject.c 2013-06-08 21:58:00 UTC (rev 57299)
@@ -1916,7 +1916,7 @@
if (is_edit) {
lt = lt->editlatt->latt;
- cpack(0x004000);
+ UI_ThemeColor(TH_WIRE_EDIT);
if (ob->defbase.first && lt->dvert) {
actdef_wcol = ob->actdef;
@@ -2461,7 +2461,7 @@
return DM_DRAW_OPTION_SKIP;
if (!BM_elem_flag_test(eed, BM_ELEM_HIDDEN) && *crease != 0.0f) {
- UI_ThemeColorBlend(TH_WIRE, TH_EDGE_CREASE, *crease);
+ UI_ThemeColorBlend(TH_WIRE_EDIT, TH_EDGE_CREASE, *crease);
return DM_DRAW_OPTION_NORMAL;
}
else {
@@ -2485,7 +2485,7 @@
return DM_DRAW_OPTION_SKIP;
if (!BM_elem_flag_test(eed, BM_ELEM_HIDDEN) && *bweight != 0.0f) {
- UI_ThemeColorBlend(TH_WIRE, TH_EDGE_SELECT, *bweight);
+ UI_ThemeColorBlend(TH_WIRE_EDIT, TH_EDGE_SELECT, *bweight);
return DM_DRAW_OPTION_NORMAL;
}
else {
@@ -2547,7 +2547,7 @@
int pass;
UI_GetThemeColor3ubv(sel ? TH_VERTEX_SELECT : TH_VERTEX, col);
- UI_GetThemeColor3ubv(sel ? TH_FACE_DOT : TH_WIRE, fcol);
+ UI_GetThemeColor3ubv(sel ? TH_FACE_DOT : TH_WIRE_EDIT, fcol);
for (pass = 0; pass < 2; pass++) {
float size = UI_GetThemeValuef(TH_VERTEX_SIZE);
@@ -2604,7 +2604,7 @@
/* since this function does transparent... */
UI_GetThemeColor4ubv(TH_EDGE_SELECT, selCol);
- UI_GetThemeColor4ubv(TH_WIRE, wireCol);
+ UI_GetThemeColor4ubv(TH_WIRE_EDIT, wireCol);
UI_GetThemeColor4ubv(TH_EDITMESH_ACTIVE, actCol);
/* when sel only is used, don't render wire, only selected, this is used for
@@ -3045,14 +3045,14 @@
/* Setup for drawing wire over, disable zbuffer
* write to show selected edge wires better */
- UI_ThemeColor(TH_WIRE);
+ UI_ThemeColor(TH_WIRE_EDIT);
bglPolygonOffset(rv3d->dist, 1.0);
glDepthMask(0);
}
else {
if (cageDM != finalDM) {
- UI_ThemeColorBlend(TH_WIRE, TH_BACK, 0.7);
+ UI_ThemeColorBlend(TH_WIRE_EDIT, TH_BACK, 0.7);
finalDM->drawEdges(finalDM, 1, 0);
}
}
@@ -5479,7 +5479,7 @@
unsigned char wire_col[3];
/* DispList */
- UI_GetThemeColor3ubv(TH_WIRE, wire_col);
+ UI_GetThemeColor3ubv(TH_WIRE_EDIT, wire_col);
glColor3ubv(wire_col);
drawDispList(scene, v3d, rv3d, base, dt, dflag, ob_wire_col);
@@ -5511,7 +5511,7 @@
* when at its lowest, don't render normals */
if ((cu->flag & CU_3D) && (ts->normalsize > 0.0015f) && (cu->drawflag & CU_HIDE_NORMALS) == 0) {
- UI_ThemeColor(TH_WIRE);
+ UI_ThemeColor(TH_WIRE_EDIT);
for (bl = cu->bev.first, nu = nurb; nu && bl; bl = bl->next, nu = nu->next) {
BevPoint *bevp = (BevPoint *)(bl + 1);
int nr = bl->nr;
@@ -5778,7 +5778,7 @@
if (mb->editelems) {
if ((G.f & G_PICKSEL) == 0) {
unsigned char wire_col[4];
- UI_GetThemeColor4ubv(TH_WIRE, wire_col);
+ UI_GetThemeColor4ubv(TH_WIRE_EDIT, wire_col);
glColor3ubv(wire_col);
drawDispList(scene, v3d, rv3d, base, dt, dflag, wire_col);
@@ -6233,7 +6233,7 @@
if (ELEM4(ob->type, OB_FONT, OB_CURVE, OB_SURF, OB_MBALL)) {
if (scene->obedit == ob) {
- UI_ThemeColor(TH_WIRE);
+ UI_ThemeColor(TH_WIRE_EDIT);
}
else {
glColor3ubv(ob_wire_col);
@@ -6337,12 +6337,12 @@
{
Object *ob = base->object;
int colindex = 0;
-
+ const bool is_edit = (ob->mode & OB_MODE_EDIT) != 0;
/* confusing logic here, there are 2 methods of setting the color
* 'colortab[colindex]' and 'theme_id', colindex overrides theme_id.
*
* note: no theme yet for 'colindex' */
- int theme_id = TH_WIRE;
+ int theme_id = is_edit ? TH_WIRE_EDIT : TH_WIRE;
int theme_shade = 0;
if ((scene->obedit == NULL) &&
@@ -6605,7 +6605,7 @@
}
if (cu->linewidth != 0.0f) {
- UI_ThemeColor(TH_WIRE);
+ UI_ThemeColor(TH_WIRE_EDIT);
copy_v3_v3(vec1, ob->orig);
copy_v3_v3(vec2, ob->orig);
vec1[0] += cu->linewidth;
Modified: trunk/blender/source/blender/makesdna/DNA_userdef_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_userdef_types.h 2013-06-08 21:48:01 UTC (rev 57298)
+++ trunk/blender/source/blender/makesdna/DNA_userdef_types.h 2013-06-08 21:58:00 UTC (rev 57299)
@@ -226,8 +226,8 @@
char hilite[4];
char grid[4];
- char wire[4], select[4];
- char lamp[4], speaker[4], empty[4], camera[4], pad[8];
+ char wire[4], wire_edit[4], select[4];
+ char lamp[4], speaker[4], empty[4], camera[4], pad[4];
char active[4], group[4], group_active[4], transform[4];
char vertex[4], vertex_select[4], vertex_unreferenced[4];
char edge[4], edge_select[4];
Modified: trunk/blender/source/blender/makesrna/intern/rna_userdef.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_userdef.c 2013-06-08 21:48:01 UTC (rev 57298)
+++ trunk/blender/source/blender/makesrna/intern/rna_userdef.c 2013-06-08 21:58:00 UTC (rev 57299)
@@ -1418,6 +1418,11 @@
RNA_def_property_ui_text(prop, "Wire", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
+ prop = RNA_def_property(srna, "wire_edit", PROP_FLOAT, PROP_COLOR_GAMMA);
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_ui_text(prop, "Wire Edit", "");
+ RNA_def_property_update(prop, 0, "rna_userdef_update");
+
prop = RNA_def_property(srna, "lamp", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 4);
RNA_def_property_ui_text(prop, "Lamp", "");
More information about the Bf-blender-cvs
mailing list