3D View Themes:

* Camera and Empty colour is now themeable. Patch by Pablo Vazquez (venomgfx) with some minor edits.
This commit is contained in:
Thomas Dinges 2012-03-23 16:14:25 +00:00
parent 3103531716
commit b331c867e1
5 changed files with 22 additions and 3 deletions

@ -133,8 +133,9 @@ enum {
TH_STRIP_SELECT,
TH_LAMP,
TH_SPEAKER,
TH_CAMERA,
TH_EMPTY,
TH_NODE,
TH_NODE_IN_OUT,

@ -245,6 +245,10 @@ const unsigned char *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colo
cp= ts->lamp; break;
case TH_SPEAKER:
cp= ts->speaker; break;
case TH_CAMERA:
cp= ts->camera; break;
case TH_EMPTY:
cp= ts->empty; break;
case TH_SELECT:
cp= ts->select; break;
case TH_ACTIVE:
@ -636,6 +640,8 @@ void ui_theme_init_default(void)
rgba_char_args_set(btheme->tv3d.wire, 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);
rgba_char_args_set(btheme->tv3d.empty, 0, 0, 0, 255);
rgba_char_args_set(btheme->tv3d.select, 241, 88, 0, 255);
rgba_char_args_set(btheme->tv3d.active, 255, 170, 64, 255);
rgba_char_args_set(btheme->tv3d.group, 8, 48, 8, 255);

@ -5877,7 +5877,7 @@ static void draw_forcefield(Scene *scene, Object *ob, RegionView3D *rv3d)
if (ob==OBACT) curcol= TH_ACTIVE;
else curcol= TH_SELECT;
}
else curcol= TH_WIRE;
else curcol= TH_EMPTY;
/* scale size of circle etc with the empty drawsize */
if (ob->type == OB_EMPTY) size = ob->empty_drawsize;
@ -6475,6 +6475,8 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
else {
if (ob->type==OB_LAMP) theme_id= TH_LAMP;
else if (ob->type==OB_SPEAKER) theme_id= TH_SPEAKER;
else if (ob->type==OB_CAMERA) theme_id= TH_CAMERA;
else if (ob->type==OB_EMPTY) theme_id= TH_EMPTY;
/* fallback to TH_WIRE */
}
}

@ -205,7 +205,7 @@ typedef struct ThemeSpace {
char grid[4];
char wire[4], select[4];
char lamp[4], speaker[4];
char lamp[4], speaker[4], empty[4],camera[4], pad[8];
char active[4], group[4], group_active[4], transform[4];
char vertex[4], vertex_select[4];
char edge[4], edge_select[4];

@ -1085,6 +1085,16 @@ static void rna_def_userdef_theme_space_view3d(BlenderRNA *brna)
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Speaker", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
prop = RNA_def_property(srna, "camera", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Camera", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
prop = RNA_def_property(srna, "empty", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Empty", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
prop = RNA_def_property(srna, "object_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "select");