diff options
author | Jeroen Bakker <j.bakker@atmind.nl> | 2013-12-02 00:30:04 +0400 |
---|---|---|
committer | Jeroen Bakker <j.bakker@atmind.nl> | 2013-12-09 23:22:15 +0400 |
commit | f120adf65ce5085ec54350b1633b25533881a251 (patch) | |
tree | 4db2fe06a31db9e1c008a12a80710da24df20d57 /source/blender/editors | |
parent | a930fb154f47a7473848254ad0b0b83c9edd1850 (diff) |
Enhancement: added node colors for every node class
In the user preferences all node classes can get its own color
The in/out color is splitted into 2 sepatate colors
the rna has been updated to better names
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/include/UI_resources.h | 12 | ||||
-rw-r--r-- | source/blender/editors/interface/resources.c | 52 | ||||
-rw-r--r-- | source/blender/editors/space_node/node_draw.c | 15 |
3 files changed, 69 insertions, 10 deletions
diff --git a/source/blender/editors/include/UI_resources.h b/source/blender/editors/include/UI_resources.h index 0c8a39a6714..af0df0e0643 100644 --- a/source/blender/editors/include/UI_resources.h +++ b/source/blender/editors/include/UI_resources.h @@ -144,9 +144,17 @@ enum { TH_EMPTY, TH_NODE, - TH_NODE_IN_OUT, + TH_NODE_INPUT, + TH_NODE_OUTPUT, + TH_NODE_COLOR, + TH_NODE_FILTER, + TH_NODE_VECTOR, + TH_NODE_TEXTURE, + TH_NODE_PATTERN, + TH_NODE_SCRIPT, + TH_NODE_LAYOUT, + TH_NODE_SHADER, TH_NODE_INTERFACE, - TH_NODE_OPERATOR, TH_NODE_CONVERTOR, TH_NODE_GROUP, TH_NODE_FRAME, diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index 81c40ec0264..21176c9a25b 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -389,10 +389,26 @@ const unsigned char *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colo case TH_NODE: cp = ts->syntaxl; break; - case TH_NODE_IN_OUT: + case TH_NODE_INPUT: cp = ts->syntaxn; break; - case TH_NODE_OPERATOR: + case TH_NODE_OUTPUT: + cp = ts->nodeclass_output; break; + case TH_NODE_COLOR: cp = ts->syntaxb; break; + case TH_NODE_FILTER: + cp = ts->nodeclass_filter; break; + case TH_NODE_VECTOR: + cp = ts->nodeclass_vector; break; + case TH_NODE_TEXTURE: + cp = ts->nodeclass_texture; break; + case TH_NODE_PATTERN: + cp = ts->nodeclass_pattern; break; + case TH_NODE_SCRIPT: + cp = ts->nodeclass_script; break; + case TH_NODE_LAYOUT: + cp = ts->nodeclass_layout; break; + case TH_NODE_SHADER: + cp = ts->nodeclass_shader; break; case TH_NODE_CONVERTOR: cp = ts->syntaxv; break; case TH_NODE_GROUP: @@ -983,10 +999,18 @@ void ui_theme_init_default(void) btheme->tnode = btheme->tv3d; rgba_char_args_set(btheme->tnode.edge_select, 255, 255, 255, 255); /* wire selected */ rgba_char_args_set(btheme->tnode.syntaxl, 155, 155, 155, 160); /* TH_NODE, backdrop */ - rgba_char_args_set(btheme->tnode.syntaxn, 100, 100, 100, 255); /* in/output */ + rgba_char_args_set(btheme->tnode.syntaxn, 100, 100, 100, 255); /* in */ + rgba_char_args_set(btheme->tnode.nodeclass_output, 100, 100, 100, 255); /* output */ rgba_char_args_set(btheme->tnode.syntaxb, 108, 105, 111, 255); /* operator */ rgba_char_args_set(btheme->tnode.syntaxv, 104, 106, 117, 255); /* generator */ rgba_char_args_set(btheme->tnode.syntaxc, 105, 117, 110, 255); /* group */ + rgba_char_args_set(btheme->tnode.nodeclass_texture, 108, 105, 111, 255); /* operator */ + rgba_char_args_set(btheme->tnode.nodeclass_shader, 108, 105, 111, 255); /* operator */ + rgba_char_args_set(btheme->tnode.nodeclass_filter, 108, 105, 111, 255); /* operator */ + rgba_char_args_set(btheme->tnode.nodeclass_script, 108, 105, 111, 255); /* operator */ + rgba_char_args_set(btheme->tnode.nodeclass_pattern, 108, 105, 111, 255); /* operator */ + rgba_char_args_set(btheme->tnode.nodeclass_vector, 108, 105, 111, 255); /* operator */ + rgba_char_args_set(btheme->tnode.nodeclass_layout, 108, 105, 111, 255); /* operator */ rgba_char_args_set(btheme->tnode.movie, 155, 155, 155, 160); /* frame */ rgba_char_args_set(btheme->tnode.syntaxs, 151, 116, 116, 255); /* matte nodes */ rgba_char_args_set(btheme->tnode.syntaxd, 116, 151, 151, 255); /* distort nodes */ @@ -2236,6 +2260,28 @@ void init_userdef_do_versions(void) } } + if (U.versionfile < 269 || (U.versionfile == 269 && U.subversionfile < 6)) { + bTheme *btheme; + for (btheme = U.themes.first; btheme; btheme = btheme->next) { + char r, g, b; + r = btheme->tnode.syntaxn[0]; + g = btheme->tnode.syntaxn[1]; + b = btheme->tnode.syntaxn[2]; + rgba_char_args_test_set(btheme->tnode.nodeclass_output, r, g, b, 255); + r = btheme->tnode.syntaxb[0]; + g = btheme->tnode.syntaxb[1]; + b = btheme->tnode.syntaxb[2]; + rgba_char_args_test_set(btheme->tnode.nodeclass_filter, r, g, b, 255); + rgba_char_args_test_set(btheme->tnode.nodeclass_vector, r, g, b, 255); + rgba_char_args_test_set(btheme->tnode.nodeclass_texture, r, g, b, 255); + rgba_char_args_test_set(btheme->tnode.nodeclass_shader, r, g, b, 255); + rgba_char_args_test_set(btheme->tnode.nodeclass_script, r, g, b, 255); + rgba_char_args_test_set(btheme->tnode.nodeclass_pattern, r, g, b, 255); + rgba_char_args_test_set(btheme->tnode.nodeclass_layout, r, g, b, 255); + } + + } + if (U.versionfile < 270) { /* grease pencil - new layer color */ if (U.gpencil_new_layer_col[3] < 0.1f) { diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c index 6f2f8dee105..5ca853e6020 100644 --- a/source/blender/editors/space_node/node_draw.c +++ b/source/blender/editors/space_node/node_draw.c @@ -562,16 +562,21 @@ int node_tweak_area_default(bNode *node, int x, int y) int node_get_colorid(bNode *node) { switch (node->typeinfo->nclass) { - case NODE_CLASS_INPUT: return TH_NODE_IN_OUT; - case NODE_CLASS_OUTPUT: return (node->flag & NODE_DO_OUTPUT) ? TH_NODE_IN_OUT : TH_NODE; + case NODE_CLASS_INPUT: return TH_NODE_INPUT; + case NODE_CLASS_OUTPUT: return (node->flag & NODE_DO_OUTPUT) ? TH_NODE_OUTPUT : TH_NODE; case NODE_CLASS_CONVERTOR: return TH_NODE_CONVERTOR; - case NODE_CLASS_OP_COLOR: - case NODE_CLASS_OP_VECTOR: - case NODE_CLASS_OP_FILTER: return TH_NODE_OPERATOR; + case NODE_CLASS_OP_COLOR: return TH_NODE_COLOR; + case NODE_CLASS_OP_VECTOR: return TH_NODE_VECTOR; + case NODE_CLASS_OP_FILTER: return TH_NODE_FILTER; case NODE_CLASS_GROUP: return TH_NODE_GROUP; case NODE_CLASS_INTERFACE: return TH_NODE_INTERFACE; case NODE_CLASS_MATTE: return TH_NODE_MATTE; case NODE_CLASS_DISTORT: return TH_NODE_DISTORT; + case NODE_CLASS_TEXTURE: return TH_NODE_TEXTURE; + case NODE_CLASS_SHADER: return TH_NODE_SHADER; + case NODE_CLASS_SCRIPT: return TH_NODE_SCRIPT; + case NODE_CLASS_PATTERN: return TH_NODE_PATTERN; + case NODE_CLASS_LAYOUT: return TH_NODE_LAYOUT; default: return TH_NODE; } } |