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

Gavin Howard gavin.d.howard at gmail.com
Sun Jan 20 05:42:10 CET 2013


     Sergey (and all),
     I wrote this patch based on a quick hack that was on the wiki's quick
hack page. (Campbell has since taken it off the page.) To be honest, I
agree with you; the code for colors is kind of messed up. In fact, both Ton
and Campbell said the same thing when I submitted the patch to them.
However, it follows the conventions of the surrounding code, which is one
of the code style guidelines.
     That doesn't mean that something can't be done about it, but I am not
in the position to make decisions about code design. I don't even have
commit privileges (which is why I did a quick hack). If something is to be
done about the current code for themes and colors, current developers are
going to have to talk about it. As for me, I have a few projects I am doing
for Blender; however, most of them are small, so I think that I would be
able to help if some decisions are made.
     Thank you to all developers, especially Campbell for being so patient
and willing to help me through my first steps. I have enjoyed working for
Blender.
     God Bless,
     Gavin Howard


On Sat, Jan 19, 2013 at 10:19 AM, Sergey Sharybin <sergey.vfx at gmail.com>wrote:

> 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
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers
>


More information about the Bf-committers mailing list