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
diff options
context:
space:
mode:
authorMatt Ebb <matt@mke3.net>2010-01-21 03:00:45 +0300
committerMatt Ebb <matt@mke3.net>2010-01-21 03:00:45 +0300
commit3e1783c715201320caf87b3660bd590892277ae2 (patch)
treee596e14a74f2fa86176c4bfd77b7b13326725c4e /source/blender/makesrna/intern
parent946cdd8ff6ad6e799c1aeaea9540b599e9648476 (diff)
New Compositor node: Hue Control
Was very quick to do, now re-aquainted with node editor. http://mke3.net/blender/devel/2.5/hue_correct_node.jpg Todo: modes for affecting hue and value on the vertical axis as well as just saturation - or if an enterprising coder wants to give it a go, let me know and I can help :)
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r--source/blender/makesrna/intern/rna_nodetree.c17
-rw-r--r--source/blender/makesrna/intern/rna_nodetree_types.h1
2 files changed, 15 insertions, 3 deletions
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index d151e911a9c..fa14bea4228 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -305,10 +305,11 @@ static void rna_Node_colorbalance_update(Main *bmain, Scene *scene, PointerRNA *
bNode *node= (bNode*)ptr->data;
NodeColorBalance *ncb = node->storage;
float lift[3], gamma[3], gain[3];
- float n_one[3] = {-1.f, -1.f, -1.f};
- mul_v3_v3fl(lift, ncb->lift, 2.f);
- add_v3_v3(lift, n_one);
+ lift[0] = (ncb->lift[0] * 2.f - 1.f)*0.5f;
+ lift[1] = (ncb->lift[1] * 2.f - 1.f)*0.5f;
+ lift[2] = (ncb->lift[2] * 2.f - 1.f)*0.5f;
+
mul_v3_v3fl(gamma, ncb->gamma, 2.f);
mul_v3_v3fl(gain, ncb->gain, 2.f);
@@ -1905,7 +1906,17 @@ static void def_cmp_colorbalance(StructRNA *srna)
RNA_def_property_ui_text(prop, "Gain", "Correction for Highlights");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_colorbalance_update");
}
+
+static void def_cmp_huecorrect(StructRNA *srna)
+{
+ PropertyRNA *prop;
+ prop = RNA_def_property(srna, "mapping", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "storage");
+ RNA_def_property_struct_type(prop, "CurveMapping");
+ RNA_def_property_ui_text(prop, "Mapping", "");
+ RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
+}
/* -- Texture Nodes --------------------------------------------------------- */
diff --git a/source/blender/makesrna/intern/rna_nodetree_types.h b/source/blender/makesrna/intern/rna_nodetree_types.h
index 936832221f9..73a1c23af50 100644
--- a/source/blender/makesrna/intern/rna_nodetree_types.h
+++ b/source/blender/makesrna/intern/rna_nodetree_types.h
@@ -108,6 +108,7 @@ DefNode( CompositorNode, CMP_NODE_VIEW_LEVELS, def_cmp_levels, "LEVEL
DefNode( CompositorNode, CMP_NODE_COLOR_MATTE, def_cmp_color_matte, "COLOR_MATTE", ColorMatte, "Color Matte", "" )
DefNode( CompositorNode, CMP_NODE_DIST_MATTE, def_cmp_distance_matte, "DISTANCE_MATTE", DistanceMatte, "Distance Matte", "" )
DefNode( CompositorNode, CMP_NODE_COLORBALANCE, def_cmp_colorbalance, "COLORBALANCE", ColorBalance, "Color Balance", "" )
+DefNode( CompositorNode, CMP_NODE_HUECORRECT, def_cmp_huecorrect, "HUECORRECT", HueCorrect, "Hue Correct", "" )
DefNode( TextureNode, TEX_NODE_OUTPUT, def_tex_output, "OUTPUT", Output, "Output", "" )
DefNode( TextureNode, TEX_NODE_CHECKER, 0, "CHECKER", Checker, "Checker", "" )