[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [47697] branches/soc-2011-tomato/source/ blender: Add screen balance into interface

Sergey Sharybin sergey.vfx at gmail.com
Sun Jun 10 19:41:14 CEST 2012


Revision: 47697
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=47697
Author:   nazgul
Date:     2012-06-10 17:41:04 +0000 (Sun, 10 Jun 2012)
Log Message:
-----------
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.

Modified Paths:
--------------
    branches/soc-2011-tomato/source/blender/compositor/nodes/COM_KeyingNode.cpp
    branches/soc-2011-tomato/source/blender/compositor/operations/COM_KeyingOperation.h
    branches/soc-2011-tomato/source/blender/editors/space_node/drawnode.c
    branches/soc-2011-tomato/source/blender/makesdna/DNA_node_types.h
    branches/soc-2011-tomato/source/blender/makesrna/intern/rna_nodetree.c
    branches/soc-2011-tomato/source/blender/nodes/composite/nodes/node_composite_keying.c

Modified: branches/soc-2011-tomato/source/blender/compositor/nodes/COM_KeyingNode.cpp
===================================================================
--- branches/soc-2011-tomato/source/blender/compositor/nodes/COM_KeyingNode.cpp	2012-06-10 17:24:05 UTC (rev 47696)
+++ branches/soc-2011-tomato/source/blender/compositor/nodes/COM_KeyingNode.cpp	2012-06-10 17:41:04 UTC (rev 47697)
@@ -180,6 +180,8 @@
 	/* keying operation */
 	KeyingOperation *keyingOperation = new KeyingOperation();
 
+	keyingOperation->setScreenBalance(keying_data->screen_balance);
+
 	inputScreen->relinkConnections(keyingOperation->getInputSocket(1), 1, graph);
 
 	if (keying_data->blur_pre) {

Modified: branches/soc-2011-tomato/source/blender/compositor/operations/COM_KeyingOperation.h
===================================================================
--- branches/soc-2011-tomato/source/blender/compositor/operations/COM_KeyingOperation.h	2012-06-10 17:24:05 UTC (rev 47696)
+++ branches/soc-2011-tomato/source/blender/compositor/operations/COM_KeyingOperation.h	2012-06-10 17:41:04 UTC (rev 47697)
@@ -46,6 +46,8 @@
 	void initExecution();
 	void deinitExecution();
 
+	void setScreenBalance(float value) {this->screenBalance = value;}
+
 	void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[]);
 };
 

Modified: branches/soc-2011-tomato/source/blender/editors/space_node/drawnode.c
===================================================================
--- branches/soc-2011-tomato/source/blender/editors/space_node/drawnode.c	2012-06-10 17:24:05 UTC (rev 47696)
+++ branches/soc-2011-tomato/source/blender/editors/space_node/drawnode.c	2012-06-10 17:41:04 UTC (rev 47697)
@@ -2446,6 +2446,7 @@
 	/* 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);

Modified: branches/soc-2011-tomato/source/blender/makesdna/DNA_node_types.h
===================================================================
--- branches/soc-2011-tomato/source/blender/makesdna/DNA_node_types.h	2012-06-10 17:24:05 UTC (rev 47696)
+++ branches/soc-2011-tomato/source/blender/makesdna/DNA_node_types.h	2012-06-10 17:41:04 UTC (rev 47697)
@@ -633,6 +633,7 @@
 } NodeKeyingScreenData;
 
 typedef struct NodeKeyingData {
+	float screen_balance;
 	float despill_factor;
 	float clip_black, clip_white;
 	int dilate_distance;

Modified: branches/soc-2011-tomato/source/blender/makesrna/intern/rna_nodetree.c
===================================================================
--- branches/soc-2011-tomato/source/blender/makesrna/intern/rna_nodetree.c	2012-06-10 17:24:05 UTC (rev 47696)
+++ branches/soc-2011-tomato/source/blender/makesrna/intern/rna_nodetree.c	2012-06-10 17:41:04 UTC (rev 47697)
@@ -3095,6 +3095,12 @@
 
 	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);

Modified: branches/soc-2011-tomato/source/blender/nodes/composite/nodes/node_composite_keying.c
===================================================================
--- branches/soc-2011-tomato/source/blender/nodes/composite/nodes/node_composite_keying.c	2012-06-10 17:24:05 UTC (rev 47696)
+++ branches/soc-2011-tomato/source/blender/nodes/composite/nodes/node_composite_keying.c	2012-06-10 17:41:04 UTC (rev 47697)
@@ -196,6 +196,7 @@
 
 	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;




More information about the Bf-blender-cvs mailing list