[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [44276] branches/tile/source/blender: Tile Branch

Jeroen Bakker j.bakker at atmind.nl
Mon Feb 20 13:19:04 CET 2012


Revision: 44276
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=44276
Author:   jbakker
Date:     2012-02-20 12:18:54 +0000 (Mon, 20 Feb 2012)
Log Message:
-----------
Tile Branch
 * added the color correction node back. Node was only merged for a part from the git branch

With the color correction node ("Color/Color correction" in the compositor node editor) colors can be manipulated using the most common color operations.
Even color channels can be enabled/disabled and fine-tuning on highlights, midtones and shadows can be tweaked.

 - At Mind -  

Modified Paths:
--------------
    branches/tile/source/blender/blenkernel/intern/node.c
    branches/tile/source/blender/editors/space_node/drawnode.c
    branches/tile/source/blender/makesrna/intern/rna_nodetree.c
    branches/tile/source/blender/makesrna/intern/rna_nodetree_types.h
    branches/tile/source/blender/nodes/CMakeLists.txt
    branches/tile/source/blender/nodes/NOD_composite.h

Added Paths:
-----------
    branches/tile/source/blender/nodes/composite/nodes/node_composite_colorcorrection.c

Modified: branches/tile/source/blender/blenkernel/intern/node.c
===================================================================
--- branches/tile/source/blender/blenkernel/intern/node.c	2012-02-20 08:06:24 UTC (rev 44275)
+++ branches/tile/source/blender/blenkernel/intern/node.c	2012-02-20 12:18:54 UTC (rev 44276)
@@ -1815,6 +1815,7 @@
 	register_node_type_cmp_alphaover(ttype);
 	register_node_type_cmp_zcombine(ttype);
 	register_node_type_cmp_colorbalance(ttype);
+	register_node_type_cmp_colorcorrection(ttype);
 	register_node_type_cmp_huecorrect(ttype);
 	
 	register_node_type_cmp_normal(ttype);

Modified: branches/tile/source/blender/editors/space_node/drawnode.c
===================================================================
--- branches/tile/source/blender/editors/space_node/drawnode.c	2012-02-20 08:06:24 UTC (rev 44275)
+++ branches/tile/source/blender/editors/space_node/drawnode.c	2012-02-20 12:18:54 UTC (rev 44276)
@@ -1702,6 +1702,92 @@
 	uiItemR(layout, ptr, "channel", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
 }
 
+static void node_composit_buts_colorcorrection(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
+{
+	uiLayout *row;
+	
+	row = uiLayoutRow(layout, 0);
+	uiItemR(row, ptr, "red", 0, NULL, ICON_NONE);
+	uiItemR(row, ptr, "green", 0, NULL, ICON_NONE);
+	uiItemR(row, ptr, "blue", 0, NULL, ICON_NONE);
+	row = uiLayoutRow(layout, 0);
+	uiItemR(row, ptr, "midtones_start", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+	uiItemR(row, ptr, "midtones_end", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+
+	row = uiLayoutRow(layout, 0);
+	uiItemR(row, ptr, "master_saturation", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+	uiItemR(row, ptr, "master_contrast", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+	uiItemR(row, ptr, "master_gamma", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+	uiItemR(row, ptr, "master_gain", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+	uiItemR(row, ptr, "master_lift", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+	row = uiLayoutRow(layout, 0);
+	uiItemL(row, "Saturation", 0);
+	uiItemL(row, "Contrast", 0);
+	uiItemL(row, "Gamma", 0);
+	uiItemL(row, "Gain", 0);
+	uiItemL(row, "Lift", 0);
+	row = uiLayoutRow(layout, 0);
+	uiItemR(row, ptr, "highlights_saturation", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+	uiItemR(row, ptr, "highlights_contrast", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+	uiItemR(row, ptr, "highlights_gamma", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+	uiItemR(row, ptr, "highlights_gain", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+	uiItemR(row, ptr, "highlights_lift", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+	row = uiLayoutRow(layout, 0);
+	uiItemR(row, ptr, "midtones_saturation", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+	uiItemR(row, ptr, "midtones_contrast", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+	uiItemR(row, ptr, "midtones_gamma", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+	uiItemR(row, ptr, "midtones_gain", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+	uiItemR(row, ptr, "midtones_lift", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+	row = uiLayoutRow(layout, 0);
+	uiItemR(row, ptr, "shadows_saturation", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+	uiItemR(row, ptr, "shadows_contrast", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+	uiItemR(row, ptr, "shadows_gamma", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+	uiItemR(row, ptr, "shadows_gain", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+	uiItemR(row, ptr, "shadows_lift", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+}
+static void node_composit_buts_colorcorrection_but(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) {
+	uiLayout *row;
+	
+	row = uiLayoutRow(layout, 0);
+	uiItemR(row, ptr, "red", 0, NULL, ICON_NONE);
+	uiItemR(row, ptr, "green", 0, NULL, ICON_NONE);
+	uiItemR(row, ptr, "blue", 0, NULL, ICON_NONE);
+	row = layout;
+	uiItemL(row, "Saturation", 0);
+	uiItemR(row, ptr, "master_saturation", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+	uiItemR(row, ptr, "highlights_saturation", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+	uiItemR(row, ptr, "midtones_saturation", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+	uiItemR(row, ptr, "shadows_saturation", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+
+	uiItemL(row, "Contrast", 0);
+	uiItemR(row, ptr, "master_contrast", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+	uiItemR(row, ptr, "highlights_contrast", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+	uiItemR(row, ptr, "midtones_contrast", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+	uiItemR(row, ptr, "shadows_contrast", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+
+	uiItemL(row, "Gamma", 0);
+	uiItemR(row, ptr, "master_gamma", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+	uiItemR(row, ptr, "highlights_gamma", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+	uiItemR(row, ptr, "midtones_gamma", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+	uiItemR(row, ptr, "shadows_gamma", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+
+	uiItemL(row, "Gain", 0);
+	uiItemR(row, ptr, "master_gain", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+	uiItemR(row, ptr, "highlights_gain", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+	uiItemR(row, ptr, "midtones_gain", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+	uiItemR(row, ptr, "shadows_gain", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+	
+	uiItemL(row, "Lift", 0);
+	uiItemR(row, ptr, "master_lift", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+	uiItemR(row, ptr, "highlights_lift", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+	uiItemR(row, ptr, "midtones_lift", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+	uiItemR(row, ptr, "shadows_lift", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+
+	row = uiLayoutRow(layout, 0);
+	uiItemR(row, ptr, "midtones_start", 0, NULL, ICON_NONE);
+	uiItemR(row, ptr, "midtones_end", 0, NULL, ICON_NONE);
+}
+
 static void node_composit_buts_colorbalance(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
 {
 	uiLayout *split, *col, *row;
@@ -2125,6 +2211,10 @@
 			ntype->uifunc=node_composit_buts_colorbalance;
 			ntype->uifuncbut=node_composit_buts_colorbalance_but;
 			break;
+		case CMP_NODE_COLORCORRECTION:
+			ntype->uifunc=node_composit_buts_colorcorrection;
+			ntype->uifuncbut=node_composit_buts_colorcorrection_but;
+			break;
 		case CMP_NODE_HUECORRECT:
 			ntype->uifunc=node_composit_buts_huecorrect;
 			break;

Modified: branches/tile/source/blender/makesrna/intern/rna_nodetree.c
===================================================================
--- branches/tile/source/blender/makesrna/intern/rna_nodetree.c	2012-02-20 08:06:24 UTC (rev 44275)
+++ branches/tile/source/blender/makesrna/intern/rna_nodetree.c	2012-02-20 12:18:54 UTC (rev 44276)
@@ -1610,6 +1610,184 @@
 		RNA_def_property_ui_text(prop, "Switch", "Border of white and black");
 		RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
 }
+
+static void def_cmp_colorcorrection(StructRNA *srna) {
+	PropertyRNA *prop;
+	prop = RNA_def_property(srna, "red", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "custom1", 1);
+	RNA_def_property_boolean_default(prop, TRUE);
+	RNA_def_property_ui_text(prop, "Red", "Red channel active");
+	RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
+	
+	prop = RNA_def_property(srna, "green", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "custom1", 2);
+	RNA_def_property_boolean_default(prop, TRUE);
+	RNA_def_property_ui_text(prop, "Green", "Green channel active");
+	RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
+	
+	prop = RNA_def_property(srna, "blue", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "custom1", 4);
+	RNA_def_property_boolean_default(prop, TRUE);
+	RNA_def_property_ui_text(prop, "Blue", "Blue channel active");
+	RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
+	
+	RNA_def_struct_sdna_from(srna, "NodeColorCorrection", "storage");
+	
+	prop = RNA_def_property(srna, "midtones_start", PROP_FLOAT, PROP_NONE);
+	RNA_def_property_float_sdna(prop, NULL, "startmidtones");
+	RNA_def_property_float_default(prop, 0.2f);
+	RNA_def_property_range(prop, 0, 1);
+	RNA_def_property_ui_text(prop, "Start of midtones", "Start of midtones");
+	RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
+	prop = RNA_def_property(srna, "midtones_end", PROP_FLOAT, PROP_NONE);
+	RNA_def_property_float_sdna(prop, NULL, "endmidtones");
+	RNA_def_property_float_default(prop, 0.7f);
+	RNA_def_property_range(prop, 0, 1);
+	RNA_def_property_ui_text(prop, "End of midtones", "end of midtones");
+	RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
+	
+	prop = RNA_def_property(srna, "master_saturation", PROP_FLOAT, PROP_NONE);
+	RNA_def_property_float_sdna(prop, NULL, "master.saturation");
+	RNA_def_property_float_default(prop, 1.0f);
+	RNA_def_property_range(prop, 0, 4);
+	RNA_def_property_ui_text(prop, "Master saturation", "Master saturation");
+	RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
+	
+	prop = RNA_def_property(srna, "master_contrast", PROP_FLOAT, PROP_NONE);
+	RNA_def_property_float_sdna(prop, NULL, "master.contrast");
+	RNA_def_property_float_default(prop, 1.0f);
+	RNA_def_property_range(prop, 0, 4);
+	RNA_def_property_ui_text(prop, "Master contrast", "Master contrast");
+	RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
+	
+	prop = RNA_def_property(srna, "master_gamma", PROP_FLOAT, PROP_NONE);
+	RNA_def_property_float_sdna(prop, NULL, "master.gamma");
+	RNA_def_property_float_default(prop, 1.0f);
+	RNA_def_property_range(prop, 0, 4);
+	RNA_def_property_ui_text(prop, "Master gamma", "Master gamma");
+	RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
+	
+	prop = RNA_def_property(srna, "master_gain", PROP_FLOAT, PROP_NONE);
+	RNA_def_property_float_sdna(prop, NULL, "master.gain");
+	RNA_def_property_float_default(prop, 1.0f);
+	RNA_def_property_range(prop, 0, 4);
+	RNA_def_property_ui_text(prop, "Master gain", "Master gain");
+	RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
+	
+	prop = RNA_def_property(srna, "master_lift", PROP_FLOAT, PROP_NONE);
+	RNA_def_property_float_sdna(prop, NULL, "master.lift");
+	RNA_def_property_float_default(prop, 0.0f);
+	RNA_def_property_range(prop, -1, 1);
+	RNA_def_property_ui_text(prop, "Master lift", "Master lift");
+	RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
+
+//
+	prop = RNA_def_property(srna, "shadows_saturation", PROP_FLOAT, PROP_NONE);
+	RNA_def_property_float_sdna(prop, NULL, "shadows.saturation");
+	RNA_def_property_float_default(prop, 1.0f);
+	RNA_def_property_range(prop, 0, 4);
+	RNA_def_property_ui_text(prop, "Shadows saturation", "Shadows saturation");

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list