Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2012-06-10 21:41:04 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2012-06-10 21:41:04 +0400
commitecbd2842dce7e8cd058f9c7088de902cc791041d (patch)
tree3b949d1487eb01523f4b69b2a44311b4baa5822b /source
parent37f702addd43c4247357877d199690a47d665d69 (diff)
Add screen balance into interface
Could be helpful to be played around. Default value is 0.5, Most probably this default value should be set manually for older files.
Diffstat (limited to 'source')
-rw-r--r--source/blender/compositor/nodes/COM_KeyingNode.cpp2
-rw-r--r--source/blender/compositor/operations/COM_KeyingOperation.h2
-rw-r--r--source/blender/editors/space_node/drawnode.c1
-rw-r--r--source/blender/makesdna/DNA_node_types.h1
-rw-r--r--source/blender/makesrna/intern/rna_nodetree.c6
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_keying.c1
6 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/compositor/nodes/COM_KeyingNode.cpp b/source/blender/compositor/nodes/COM_KeyingNode.cpp
index 2bc502a5f86..05d4738de94 100644
--- a/source/blender/compositor/nodes/COM_KeyingNode.cpp
+++ b/source/blender/compositor/nodes/COM_KeyingNode.cpp
@@ -180,6 +180,8 @@ void KeyingNode::convertToOperations(ExecutionSystem *graph, CompositorContext *
/* keying operation */
KeyingOperation *keyingOperation = new KeyingOperation();
+ keyingOperation->setScreenBalance(keying_data->screen_balance);
+
inputScreen->relinkConnections(keyingOperation->getInputSocket(1), 1, graph);
if (keying_data->blur_pre) {
diff --git a/source/blender/compositor/operations/COM_KeyingOperation.h b/source/blender/compositor/operations/COM_KeyingOperation.h
index 0ce6481b835..1232d008ac8 100644
--- a/source/blender/compositor/operations/COM_KeyingOperation.h
+++ b/source/blender/compositor/operations/COM_KeyingOperation.h
@@ -46,6 +46,8 @@ public:
void initExecution();
void deinitExecution();
+ void setScreenBalance(float value) {this->screenBalance = value;}
+
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[]);
};
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c
index aed282e4a4a..afaa7ac8a28 100644
--- a/source/blender/editors/space_node/drawnode.c
+++ b/source/blender/editors/space_node/drawnode.c
@@ -2446,6 +2446,7 @@ static void node_composit_buts_keying(uiLayout *layout, bContext *UNUSED(C), Poi
/* bNode *node= ptr->data; */ /* UNUSED */
uiItemR(layout, ptr, "blur_pre", 0, NULL, ICON_NONE);
+ uiItemR(layout, ptr, "screen_balance", 0, NULL, ICON_NONE);
uiItemR(layout, ptr, "despill_factor", 0, NULL, ICON_NONE);
uiItemR(layout, ptr, "clip_black", 0, NULL, ICON_NONE);
uiItemR(layout, ptr, "clip_white", 0, NULL, ICON_NONE);
diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h
index a441936e054..cfc8ba526fa 100644
--- a/source/blender/makesdna/DNA_node_types.h
+++ b/source/blender/makesdna/DNA_node_types.h
@@ -633,6 +633,7 @@ typedef struct NodeKeyingScreenData {
} NodeKeyingScreenData;
typedef struct NodeKeyingData {
+ float screen_balance;
float despill_factor;
float clip_black, clip_white;
int dilate_distance;
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index 7567d40d9a5..96258eff9c5 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -3095,6 +3095,12 @@ static void def_cmp_keying(StructRNA *srna)
RNA_def_struct_sdna_from(srna, "NodeKeyingData", "storage");
+ prop = RNA_def_property(srna, "screen_balance", PROP_FLOAT, PROP_FACTOR);
+ RNA_def_property_float_sdna(prop, NULL, "screen_balance");
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_ui_text(prop, "Screen Balance", "");
+ RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
+
prop = RNA_def_property(srna, "despill_factor", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "despill_factor");
RNA_def_property_range(prop, 0.0f, 1.0f);
diff --git a/source/blender/nodes/composite/nodes/node_composite_keying.c b/source/blender/nodes/composite/nodes/node_composite_keying.c
index b5f9b823ac2..16a9168e406 100644
--- a/source/blender/nodes/composite/nodes/node_composite_keying.c
+++ b/source/blender/nodes/composite/nodes/node_composite_keying.c
@@ -196,6 +196,7 @@ static void node_composit_init_keying(bNodeTree *UNUSED(ntree), bNode* node, bNo
data = MEM_callocN(sizeof(NodeKeyingData), "node keying data");
+ data->screen_balance = 0.5f;
data->despill_factor = 1.0f;
data->clip_black = 0.0f;
data->clip_white = 1.0f;