3D View Themes:
authorThomas Dinges <blender@dingto.org>
Fri, 23 Mar 2012 16:14:25 +0000 (16:14 +0000)
committerThomas Dinges <blender@dingto.org>
Fri, 23 Mar 2012 16:14:25 +0000 (16:14 +0000)
* Camera and Empty colour is now themeable. Patch by Pablo Vazquez (venomgfx) with some minor edits.

source/blender/editors/include/UI_resources.h
source/blender/editors/interface/resources.c
source/blender/editors/space_view3d/drawobject.c
source/blender/makesdna/DNA_userdef_types.h
source/blender/makesrna/intern/rna_userdef.c

index c329a784d1840d5b1ba017593a2a70733675fa5f..c470b13aa690ac734d287af8dff45113c70e0ac3 100644 (file)
@@ -133,8 +133,9 @@ enum {
        TH_STRIP_SELECT,
        
        TH_LAMP,
-
        TH_SPEAKER,
+       TH_CAMERA,
+       TH_EMPTY,
        
        TH_NODE,
        TH_NODE_IN_OUT,
index 448c076a6a11ef800933dccad44be1e2a0c26887..124ce77325b5184ed36f193d684e33a763884007 100644 (file)
@@ -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);
index f18ee9220a90b6bc83bffcda736c90d37eb25227..c0c117242d7130c4f40de490b416b557d4046a46 100644 (file)
@@ -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 */
                                        }
                                }
index 9c8c3a7731cdd159f0b8a72afe96a8ae4a15f824..40c4a7fab9d12abd6dd6789d127483ca9a747e35 100644 (file)
@@ -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];
index dd26df0a10f171024518c2a9118243be453abe31..8e4ebe0b22ecd84c74e499ef4b4df93f7a4ad914 100644 (file)
@@ -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");