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 | |
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')
-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 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_userdef_types.h | 13 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_userdef.c | 64 |
5 files changed, 134 insertions, 22 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; } } diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index b65c7c1bc46..6aab0a0a0d1 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -257,10 +257,15 @@ typedef struct ThemeSpace { char noodle_curving; /* syntax for textwindow and nodes */ - char syntaxl[4], syntaxs[4]; - char syntaxb[4], syntaxn[4]; - char syntaxv[4], syntaxc[4]; - char syntaxd[4], syntaxr[4]; + char syntaxl[4], syntaxs[4]; // in nodespace used for backdrop matte + char syntaxb[4], syntaxn[4]; // in nodespace used for color input + char syntaxv[4], syntaxc[4]; // in nodespace used for converter group + char syntaxd[4], syntaxr[4]; // in nodespace used for distort + + char nodeclass_output[4], nodeclass_filter[4]; + char nodeclass_vector[4], nodeclass_texture[4]; + char nodeclass_shader[4], nodeclass_script[4]; + char nodeclass_pattern[4], nodeclass_layout[4]; char movie[4], movieclip[4], mask[4], image[4], scene[4], audio[4]; /* for sequence editor */ char effect[4], transition[4], meta[4]; diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 171a48e81a0..f138964f8e3 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -1964,22 +1964,16 @@ static void rna_def_userdef_theme_space_node(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Node Backdrop", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - prop = RNA_def_property(srna, "in_out_node", PROP_FLOAT, PROP_COLOR_GAMMA); - RNA_def_property_float_sdna(prop, NULL, "syntaxn"); - RNA_def_property_array(prop, 3); - RNA_def_property_ui_text(prop, "In/Out Node", ""); - RNA_def_property_update(prop, 0, "rna_userdef_update"); - prop = RNA_def_property(srna, "converter_node", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "syntaxv"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Converter Node", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - prop = RNA_def_property(srna, "operator_node", PROP_FLOAT, PROP_COLOR_GAMMA); + prop = RNA_def_property(srna, "color_node", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "syntaxb"); RNA_def_property_array(prop, 3); - RNA_def_property_ui_text(prop, "Operator Node", ""); + RNA_def_property_ui_text(prop, "Color Node", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); prop = RNA_def_property(srna, "group_node", PROP_FLOAT, PROP_COLOR_GAMMA); @@ -2018,6 +2012,60 @@ static void rna_def_userdef_theme_space_node(BlenderRNA *brna) RNA_def_property_range(prop, 0, 10); RNA_def_property_ui_text(prop, "Noodle curving", "Curving of the noodle"); RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop = RNA_def_property(srna, "input_node", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_float_sdna(prop, NULL, "syntaxn"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Input Node", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop = RNA_def_property(srna, "output_node", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_float_sdna(prop, NULL, "nodeclass_output"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Output Node", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop = RNA_def_property(srna, "filter_node", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_float_sdna(prop, NULL, "nodeclass_filter"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Filter Node", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop = RNA_def_property(srna, "vector_node", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_float_sdna(prop, NULL, "nodeclass_vector"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Vector Node", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop = RNA_def_property(srna, "texture_node", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_float_sdna(prop, NULL, "nodeclass_texture"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Texture Node", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop = RNA_def_property(srna, "shader_node", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_float_sdna(prop, NULL, "nodeclass_shader"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Shader Node", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop = RNA_def_property(srna, "script_node", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_float_sdna(prop, NULL, "nodeclass_script"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Script Node", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop = RNA_def_property(srna, "pattern_node", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_float_sdna(prop, NULL, "nodeclass_pattern"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Pattern Node", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop = RNA_def_property(srna, "layout_node", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_float_sdna(prop, NULL, "nodeclass_layout"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Layout Node", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); } static void rna_def_userdef_theme_space_logic(BlenderRNA *brna) |