diff options
author | Matt Ebb <matt@mke3.net> | 2010-01-20 07:19:55 +0300 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2010-01-20 07:19:55 +0300 |
commit | 1d3186cbcf9e3e463e4e6362ac76862b801cf7ba (patch) | |
tree | 450dc8b914efeb8829f815dbba1f9aabd7449a0f /source/blender/editors/space_node | |
parent | 8bcf66e1d16ece55f8736797f7d4180a456060ff (diff) |
Durian request: Added 'Color Balance' node to compositor. uses Lift/Gamma/Gain
similar to sequence editor.
--> http://mke3.net/blender/devel/2.5/color_balance_node.jpg
Also added 0 key (zero key) shortcut when mouse is over a button, to reset it to its default value.
Same as the RMB menu ->Reset to Default, except for color wheels, it only resets the hue/sat/value
components that that widget affects.
Peter/Xavier: The existing color balance code can generate NaNs (fractional power of a negative),
which causes havoc along the image pipeline. I added a check in the node code to prevent this.
Still plenty of potential for lots of better colour correction tools in the compositor, just needs time...
Diffstat (limited to 'source/blender/editors/space_node')
-rw-r--r-- | source/blender/editors/space_node/drawnode.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index 5c5e316663c..3323183cb54 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -913,6 +913,28 @@ static void node_composit_buts_view_levels(uiLayout *layout, bContext *C, Pointe uiItemR(layout, NULL, 0, ptr, "channel", UI_ITEM_R_EXPAND); } +static void node_composit_buts_colorbalance(uiLayout *layout, bContext *C, PointerRNA *ptr) +{ + uiLayout *split, *col, *row; + + split = uiLayoutSplit(layout, 0, 0); + col = uiLayoutColumn(split, 0); + uiTemplateColorWheel(col, ptr, "lift", 1); + row = uiLayoutRow(col, 0); + uiItemR(row, NULL, 0, ptr, "lift", 0); + + col = uiLayoutColumn(split, 0); + uiTemplateColorWheel(col, ptr, "gamma", 1); + row = uiLayoutRow(col, 0); + uiItemR(row, NULL, 0, ptr, "gamma", 0); + + col = uiLayoutColumn(split, 0); + uiTemplateColorWheel(col, ptr, "gain", 1); + row = uiLayoutRow(col, 0); + uiItemR(row, NULL, 0, ptr, "gain", 0); + +} + /* only once called */ static void node_composit_set_butfunc(bNodeType *ntype) { @@ -1042,9 +1064,12 @@ static void node_composit_set_butfunc(bNodeType *ntype) case CMP_NODE_PREMULKEY: ntype->uifunc= node_composit_buts_premulkey; break; - case CMP_NODE_VIEW_LEVELS: + case CMP_NODE_VIEW_LEVELS: ntype->uifunc=node_composit_buts_view_levels; break; + case CMP_NODE_COLORBALANCE: + ntype->uifunc=node_composit_buts_colorbalance; + break; default: ntype->uifunc= NULL; } |