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:
authorJeroen Bakker <j.bakker@atmind.nl>2018-08-23 11:25:54 +0300
committerJeroen Bakker <j.bakker@atmind.nl>2018-08-23 12:39:11 +0300
commit4de7c0c3105a80d244dd9f2078c310331873a16b (patch)
tree35c091edbd67d2d3fbbbfb078f0085df52999458 /source/blender/makesrna
parent01973290a9fd6c7e48ab4d19043eb3a26939cb4e (diff)
Compositor: Film-like curve
Film-like curves for the RGB Curve node (Compositor) and Curve Modifier (Sequencer) Film-like curves originated from Adobe. "It’s an RGB curve where the tone curve is applied on the largest and smallest value, and then the middle value is adapted to keep a constant hue as defined by RGB-HSL/HSV. In terms of look and saturation increase it’s very similar to a pure RGB curve, more so than a HSL-L curve or HSV-V curve, but some color shift problems are avoided." Other tools like Natron, Krita and RawTherapee have implemented this curve tone. Reviewers: brecht, campbellbarton Reviewed By: brecht Tags: #compositing, #video_sequencer Differential Revision: https://developer.blender.org/D3638
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r--source/blender/makesrna/intern/rna_color.c19
-rw-r--r--source/blender/makesrna/intern/rna_ui_api.c1
2 files changed, 20 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_color.c b/source/blender/makesrna/intern/rna_color.c
index 083551f2367..4cbe365167c 100644
--- a/source/blender/makesrna/intern/rna_color.c
+++ b/source/blender/makesrna/intern/rna_color.c
@@ -114,6 +114,12 @@ static void rna_CurveMapping_white_level_set(PointerRNA *ptr, const float *value
curvemapping_set_black_white(cumap, NULL, NULL);
}
+static void rna_CurveMapping_tone_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *UNUSED(ptr))
+{
+ WM_main_add_notifier(NC_NODE | NA_EDITED, NULL);
+ WM_main_add_notifier(NC_SCENE | ND_SEQUENCER, NULL);
+}
+
static void rna_CurveMapping_clipminx_range(PointerRNA *ptr, float *min, float *max,
float *UNUSED(softmin), float *UNUSED(softmax))
{
@@ -757,11 +763,24 @@ static void rna_def_curvemapping(BlenderRNA *brna)
PropertyRNA *prop;
FunctionRNA *func;
+ static const EnumPropertyItem tone_items[] = {
+ {CURVE_TONE_STANDARD, "STANDARD", 0, "Standard", ""},
+ {CURVE_TONE_FILMLIKE, "FILMLIKE", 0, "Film like", ""},
+ {0, NULL, 0, NULL, NULL}
+ };
+
srna = RNA_def_struct(brna, "CurveMapping", NULL);
RNA_def_struct_ui_text(srna, "CurveMapping",
"Curve mapping to map color, vector and scalar values to other values using "
"a user defined curve");
+ prop = RNA_def_property(srna, "tone", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "tone");
+ RNA_def_property_enum_items(prop, tone_items);
+ RNA_def_property_ui_text(prop, "Tone", "Tone of the curve");
+ RNA_def_property_update(prop, 0, "rna_CurveMapping_tone_update");
+
+
prop = RNA_def_property(srna, "use_clip", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CUMA_DO_CLIP);
RNA_def_property_ui_text(prop, "Clip", "Force the curve view to fit a defined boundary");
diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c
index a5deb0a32f1..6abd0002e3e 100644
--- a/source/blender/makesrna/intern/rna_ui_api.c
+++ b/source/blender/makesrna/intern/rna_ui_api.c
@@ -883,6 +883,7 @@ void RNA_api_ui_layout(StructRNA *srna)
RNA_def_boolean(func, "levels", false, "", "Show black/white levels");
RNA_def_boolean(func, "brush", false, "", "Show brush options");
RNA_def_boolean(func, "use_negative_slope", false, "", "Use a negative slope by default");
+ RNA_def_boolean(func, "show_tone", false, "", "Show tone options");
func = RNA_def_function(srna, "template_color_ramp", "uiTemplateColorRamp");
RNA_def_function_ui_description(func, "Item. A color ramp widget");