[Bf-committers] [Bf-blender-cvs] SVN commit: /data/svn/bf-blender [53908] trunk/blender/source/blender: patch [#33923] Patch for Node Theme Colors

Sergey Sharybin sergey.vfx at gmail.com
Sat Jan 19 18:19:46 CET 2013


I'm not so much sure such approach is indeed cool here.

First, why only matte and distort and not other nodes?
Second, we already do have custom node colors, which already was served for
such kind of node highlight. Now we do have two separated ways of affecting
on visual feedback which is a bit cluttered i think.

IMO, nicer approach would be to define some kind of custom color presets
for different node types. Any node types, not just two of them. Maybe even
make it stored in .blend file, because in different projects/files i could
be interested more in different types of operations. Also, maybe make node
header depend on custom node color, like shade it by multiplying by 0.5
(just quick idea).

Color feedback could indeed help here, but currently it's a bit of mess
here i think and could be made much nicer..


On Sat, Jan 19, 2013 at 10:21 AM, Campbell Barton <ideasman42 at gmail.com>wrote:

> Revision: 53908
>
> http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=53908
> Author:   campbellbarton
> Date:     2013-01-19 04:20:53 +0000 (Sat, 19 Jan 2013)
> Log Message:
> -----------
> patch [#33923] Patch for Node Theme Colors
> from Gavin Howard (gdh)
>
> Modified Paths:
> --------------
>     trunk/blender/source/blender/editors/include/UI_resources.h
>     trunk/blender/source/blender/editors/interface/resources.c
>     trunk/blender/source/blender/editors/space_node/node_draw.c
>     trunk/blender/source/blender/makesrna/intern/rna_userdef.c
>
> Modified: trunk/blender/source/blender/editors/include/UI_resources.h
> ===================================================================
> --- trunk/blender/source/blender/editors/include/UI_resources.h 2013-01-19
> 03:51:17 UTC (rev 53907)
> +++ trunk/blender/source/blender/editors/include/UI_resources.h 2013-01-19
> 04:20:53 UTC (rev 53908)
> @@ -147,6 +147,8 @@
>         TH_NODE_CONVERTOR,
>         TH_NODE_GROUP,
>         TH_NODE_FRAME,
> +       TH_NODE_MATTE,
> +       TH_NODE_DISTORT,
>
>         TH_CONSOLE_OUTPUT,
>         TH_CONSOLE_INPUT,
>
> Modified: trunk/blender/source/blender/editors/interface/resources.c
> ===================================================================
> --- trunk/blender/source/blender/editors/interface/resources.c  2013-01-19
> 03:51:17 UTC (rev 53907)
> +++ trunk/blender/source/blender/editors/interface/resources.c  2013-01-19
> 04:20:53 UTC (rev 53908)
> @@ -389,6 +389,10 @@
>                                         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 @@
>                         btheme->tclip.panelcolors = btheme->tui.panel;
>                 }
>         }
> -
> +
>         if (bmain->versionfile < 266) {
>                 bTheme *btheme;
>
> @@ -2120,6 +2124,14 @@
>                 }
>         }
>
> +       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;
>
>
> Modified: trunk/blender/source/blender/editors/space_node/node_draw.c
> ===================================================================
> --- trunk/blender/source/blender/editors/space_node/node_draw.c 2013-01-19
> 03:51:17 UTC (rev 53907)
> +++ trunk/blender/source/blender/editors/space_node/node_draw.c 2013-01-19
> 04:20:53 UTC (rev 53908)
> @@ -501,21 +501,18 @@
>
>  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()
>
> Modified: trunk/blender/source/blender/makesrna/intern/rna_userdef.c
> ===================================================================
> --- trunk/blender/source/blender/makesrna/intern/rna_userdef.c  2013-01-19
> 03:51:17 UTC (rev 53907)
> +++ trunk/blender/source/blender/makesrna/intern/rna_userdef.c  2013-01-19
> 04:20:53 UTC (rev 53908)
> @@ -1884,7 +1884,19 @@
>         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");
>         RNA_def_property_int_default(prop, 5);
>
> _______________________________________________
> Bf-blender-cvs mailing list
> Bf-blender-cvs at blender.org
> http://lists.blender.org/mailman/listinfo/bf-blender-cvs
>



-- 
With best regards, Sergey Sharybin


More information about the Bf-committers mailing list