Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-01-19 08:20:53 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-01-19 08:20:53 +0400
commit905186856426dce4a61673870a8dd9f7597c09bd (patch)
tree5c032fbd0e6bb157404fab6fbff3270d4c787ae2 /source/blender
parent9a4da5a2f1adea4928d94b61c0f99b2e8a3c7c9f (diff)
patch [#33923] Patch for Node Theme Colors
from Gavin Howard (gdh)
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/include/UI_resources.h2
-rw-r--r--source/blender/editors/interface/resources.c14
-rw-r--r--source/blender/editors/space_node/node_draw.c25
-rw-r--r--source/blender/makesrna/intern/rna_userdef.c12
4 files changed, 38 insertions, 15 deletions
diff --git a/source/blender/editors/include/UI_resources.h b/source/blender/editors/include/UI_resources.h
index 7e7be17d7c6..f8eae840471 100644
--- a/source/blender/editors/include/UI_resources.h
+++ b/source/blender/editors/include/UI_resources.h
@@ -147,6 +147,8 @@ enum {
TH_NODE_CONVERTOR,
TH_NODE_GROUP,
TH_NODE_FRAME,
+ TH_NODE_MATTE,
+ TH_NODE_DISTORT,
TH_CONSOLE_OUTPUT,
TH_CONSOLE_INPUT,
diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c
index ac7d423bf00..e3fbbc26d0d 100644
--- a/source/blender/editors/interface/resources.c
+++ b/source/blender/editors/interface/resources.c
@@ -389,6 +389,10 @@ const unsigned char *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colo
cp = ts->syntaxc; break;
case TH_NODE_FRAME:
cp = ts->movie; break;
+ case TH_NODE_MATTE:
+ cp = ts->syntaxs; break;
+ case TH_NODE_DISTORT:
+ cp = ts->syntaxd; break;
case TH_NODE_CURVING:
cp = &ts->noodle_curving; break;
@@ -2091,7 +2095,7 @@ void init_userdef_do_versions(void)
btheme->tclip.panelcolors = btheme->tui.panel;
}
}
-
+
if (bmain->versionfile < 266) {
bTheme *btheme;
@@ -2120,6 +2124,14 @@ void init_userdef_do_versions(void)
}
}
+ if (!MAIN_VERSION_ATLEAST(bmain, 265, 9)) {
+ bTheme *btheme;
+ for (btheme = U.themes.first; btheme; btheme = btheme->next) {
+ rgba_char_args_test_set(btheme->tnode.syntaxs, 151, 116, 116, 255); /* matte nodes */
+ rgba_char_args_test_set(btheme->tnode.syntaxd, 116, 151, 151, 255); /* distort nodes */
+ }
+ }
+
if (U.pixelsize == 0.0f)
U.pixelsize = 1.0f;
diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c
index 2b106377f4e..5efb43be29c 100644
--- a/source/blender/editors/space_node/node_draw.c
+++ b/source/blender/editors/space_node/node_draw.c
@@ -501,21 +501,18 @@ int node_tweak_area_default(bNode *node, int x, int y)
int node_get_colorid(bNode *node)
{
- if (node->typeinfo->nclass == NODE_CLASS_INPUT)
- return TH_NODE_IN_OUT;
- if (node->typeinfo->nclass == NODE_CLASS_OUTPUT) {
- if (node->flag & NODE_DO_OUTPUT)
- return TH_NODE_IN_OUT;
- else
- return TH_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_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_GROUP: return TH_NODE_GROUP;
+ case NODE_CLASS_MATTE: return TH_NODE_MATTE;
+ case NODE_CLASS_DISTORT: return TH_NODE_DISTORT;
+ default: return TH_NODE;
}
- if (node->typeinfo->nclass == NODE_CLASS_CONVERTOR)
- return TH_NODE_CONVERTOR;
- if (ELEM3(node->typeinfo->nclass, NODE_CLASS_OP_COLOR, NODE_CLASS_OP_VECTOR, NODE_CLASS_OP_FILTER))
- return TH_NODE_OPERATOR;
- if (node->typeinfo->nclass == NODE_CLASS_GROUP)
- return TH_NODE_GROUP;
- return TH_NODE;
}
/* note: in cmp_util.c is similar code, for node_compo_pass_on()
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index 70399888e5a..67cc833ffb6 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -1884,6 +1884,18 @@ static void rna_def_userdef_theme_space_node(BlenderRNA *brna)
RNA_def_property_array(prop, 4);
RNA_def_property_ui_text(prop, "Frame Node", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
+
+ prop = RNA_def_property(srna, "matte_node", PROP_FLOAT, PROP_COLOR_GAMMA);
+ RNA_def_property_float_sdna(prop, NULL, "syntaxs");
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_ui_text(prop, "Matte Node", "");
+ RNA_def_property_update(prop, 0, "rna_userdef_update");
+
+ prop = RNA_def_property(srna, "distor_node", PROP_FLOAT, PROP_COLOR_GAMMA);
+ RNA_def_property_float_sdna(prop, NULL, "syntaxd");
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_ui_text(prop, "Distort Node", "");
+ RNA_def_property_update(prop, 0, "rna_userdef_update");
prop = RNA_def_property(srna, "noodle_curving", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "noodle_curving");