patch [#33923] Patch for Node Theme Colors

from Gavin Howard (gdh)
This commit is contained in:
Campbell Barton 2013-01-19 04:20:53 +00:00
parent 9a4da5a2f1
commit 9051868564
4 changed files with 38 additions and 15 deletions

@ -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,

@ -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;

@ -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()

@ -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");