|
GimpChat Member |
|
Joined: Oct 31, 2020 Posts: 1450
|
Attachment:
cm.png [ 225.03 KiB | Viewed 5535 times ]
Ring Bevel got a color change checkbox that when enabled makes the bevel any color. How did this happen? This code below list 8 GEGL graphs total, with four GEGL graphs for each ring (we established that already), with an almost carbon copy of the first four nodes and the last four nodes except the first four nodes contain a state->color node at the beginning. Those first four rings are the ones that are recolored when the checkbox is enabled. state->color is gegl:coloroverlay colormode is a GUI property for the checkbox.
Notice how the node state->color is only on the top four graphs and is not present after the else?if (o->colormode)
switch (o->rings) { break; case onering: gegl_node_link_many (state->input, state->color, state->mediandictator, state->levels, state->idref, state->erase, state->bevel, state->behind, state->output, NULL); gegl_node_link_many (state->idref, state->median, state->s1, state->fix, NULL); gegl_node_connect_from (state->erase, "aux", state->fix, "output"); gegl_node_link_many (state->idref, state->bevel2, NULL); gegl_node_connect_from (state->behind, "aux", state->bevel2, "output"); break; case tworings: gegl_node_link_many (state->input, state->color, state->mediandictator, state->levels, state->idref, state->erase, state->bevel, state->behind, state->output, NULL); gegl_node_link_many (state->idref, state->median, state->s1, state->s2, state->fix, NULL); gegl_node_connect_from (state->erase, "aux", state->fix, "output"); gegl_node_link_many (state->idref, state->bevel2, NULL); gegl_node_connect_from (state->behind, "aux", state->bevel2, "output"); break; case threerings: gegl_node_link_many (state->input, state->color, state->mediandictator, state->levels, state->idref, state->erase, state->bevel, state->behind, state->output, NULL); gegl_node_link_many (state->idref, state->median, state->s1, state->s2, state->s3, state->fix, NULL); gegl_node_connect_from (state->erase, "aux", state->fix, "output"); gegl_node_link_many (state->idref, state->bevel2, NULL); gegl_node_connect_from (state->behind, "aux", state->bevel2, "output"); break; case fourrings: gegl_node_link_many (state->input, state->color, state->mediandictator, state->levels, state->idref, state->erase, state->bevel, state->behind, state->output, NULL); gegl_node_link_many (state->idref, state->median, state->s1, state->s2, state->s3, state->s4, state->fix, NULL); gegl_node_connect_from (state->erase, "aux", state->fix, "output"); gegl_node_link_many (state->idref, state->bevel2, NULL); gegl_node_connect_from (state->behind, "aux", state->bevel2, "output");
}
else
switch (o->rings) { break; case onering: gegl_node_link_many (state->input, state->mediandictator, state->levels, state->idref, state->erase, state->bevel, state->behind, state->output, NULL); gegl_node_link_many (state->idref, state->median, state->s1, state->fix, NULL); gegl_node_connect_from (state->erase, "aux", state->fix, "output"); gegl_node_link_many (state->idref, state->bevel2, NULL); gegl_node_connect_from (state->behind, "aux", state->bevel2, "output"); break; case tworings: gegl_node_link_many (state->input, state->mediandictator, state->levels, state->idref, state->erase, state->bevel, state->behind, state->output, NULL); gegl_node_link_many (state->idref, state->median, state->s1, state->s2, state->fix, NULL); gegl_node_connect_from (state->erase, "aux", state->fix, "output"); gegl_node_link_many (state->idref, state->bevel2, NULL); gegl_node_connect_from (state->behind, "aux", state->bevel2, "output"); break; case threerings: gegl_node_link_many (state->input, state->mediandictator, state->levels, state->idref, state->erase, state->bevel, state->behind, state->output, NULL); gegl_node_link_many (state->idref, state->median, state->s1, state->s2, state->s3, state->fix, NULL); gegl_node_connect_from (state->erase, "aux", state->fix, "output"); gegl_node_link_many (state->idref, state->bevel2, NULL); gegl_node_connect_from (state->behind, "aux", state->bevel2, "output"); break; case fourrings: gegl_node_link_many (state->input, state->mediandictator, state->levels, state->idref, state->erase, state->bevel, state->behind, state->output, NULL); gegl_node_link_many (state->idref, state->median, state->s1, state->s2, state->s3, state->s4, state->fix, NULL); gegl_node_connect_from (state->erase, "aux", state->fix, "output"); gegl_node_link_many (state->idref, state->bevel2, NULL); gegl_node_connect_from (state->behind, "aux", state->bevel2, "output");
} }
This is the GUI aspect of the color checkbox. property_boolean (colormode, _("Recolor bevel"), FALSE) description (_("Recolor Bevel with whatever color you want. By default this is disabled."))
property_color (color, _("Color of bevel"), "#ff9f00") description (_("Optional Color Overlay for Ringed Bevel. Is only enabled if its checkbox is on.")) ui_meta ("sensitive", "colormode")
|
|