diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-08-11 18:37:58 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-08-11 18:37:58 +0400 |
commit | a794e19346ab6ee30e14e8175c153b03fa6cb7a5 (patch) | |
tree | 611279ea79071664c525cc978758b92758b652a5 /source/blender/makesrna | |
parent | be4ae581fff820cefc21d150080e13f621b99cdd (diff) |
Sequencer: support for masked color balance
This implements option which could be used to color balance only
specified area. Currently done by adding Mask input to Adjustment
effect. Affects on color balance and multiply settings.
Supporting masked saturation control is in the list, not supported
in this commit.
Also show value slider in the right of color wheel.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_sequencer.c | 71 |
1 files changed, 53 insertions, 18 deletions
diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c index 8c0c87e5696..06742f55774 100644 --- a/source/blender/makesrna/intern/rna_sequencer.c +++ b/source/blender/makesrna/intern/rna_sequencer.c @@ -55,6 +55,7 @@ typedef struct EffectInfo { const char *ui_desc; void (*func)(StructRNA *); int inputs; + int supports_mask; } EffectInfo; #ifdef RNA_RUNTIME @@ -590,6 +591,13 @@ static int rna_Sequence_input_count_get(PointerRNA *ptr) return BKE_sequence_effect_get_num_inputs(seq->type); } +static int rna_Sequence_supports_mask_get(PointerRNA *ptr) +{ + Sequence *seq = (Sequence *)(ptr->data); + + return BKE_sequence_effect_get_supports_mask(seq->type); +} + #if 0 static void rna_SoundSequence_filename_set(PointerRNA *ptr, const char *value) { @@ -616,6 +624,20 @@ static void rna_Sequence_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *p } } +static int rna_Sequence_otherSequence_poll(PointerRNA *ptr, PointerRNA value) +{ + Sequence *seq = (Sequence *) ptr->data; + Sequence *cur = (Sequence *) value.data; + + if (seq == cur) + return FALSE; + + if (BKE_sequence_check_depend(seq, cur)) + return FALSE; + + return TRUE; +} + static void rna_Sequence_update_reopen_files(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr) { Editing *ed = BKE_sequencer_editing_get(scene, FALSE); @@ -1412,7 +1434,7 @@ static void rna_def_input(StructRNA *srna) RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update"); } -static void rna_def_effect_inputs(StructRNA *srna, int count) +static void rna_def_effect_inputs(StructRNA *srna, int count, int supports_mask) { PropertyRNA *prop; @@ -1420,6 +1442,10 @@ static void rna_def_effect_inputs(StructRNA *srna, int count) RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_int_funcs(prop, "rna_Sequence_input_count_get", NULL, NULL); + prop = RNA_def_property(srna, "is_supports_mask", PROP_INT, PROP_UNSIGNED); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_int_funcs(prop, "rna_Sequence_supports_mask_get", NULL, NULL); + if (count >= 1) { prop = RNA_def_property(srna, "input_1", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "seq1"); @@ -1442,6 +1468,15 @@ static void rna_def_effect_inputs(StructRNA *srna, int count) RNA_def_property_ui_text(prop, "Input 3", "Third input for the effect strip"); } */ + + if (supports_mask) { + prop = RNA_def_property(srna, "input_mask", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_sdna(prop, NULL, "mask_sequence"); + RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Sequence_otherSequence_poll"); + RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Mask", "Mask input for the effect strip"); + RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update"); + } } static void rna_def_image(BlenderRNA *brna) @@ -1884,50 +1919,50 @@ static void rna_def_speed_control(StructRNA *srna) static EffectInfo def_effects[] = { {"AddSequence", "Add Sequence", "Add Sequence", - NULL, 2}, + NULL, 2, FALSE}, {"AdjustmentSequence", "Adjustment Layer Sequence", "Sequence strip to perform filter adjustments to layers below", - rna_def_input, 0}, + rna_def_input, 0, TRUE}, {"AlphaOverSequence", "Alpha Over Sequence", "Alpha Over Sequence", - NULL, 2}, + NULL, 2, FALSE}, {"AlphaUnderSequence", "Alpha Under Sequence", "Alpha Under Sequence", - NULL, 2}, + NULL, 2, FALSE}, {"ColorSequence", "Color Sequence", "Sequence strip creating an image filled with a single color", - rna_def_solid_color, 0}, + rna_def_solid_color, 0, FALSE}, {"CrossSequence", "Cross Sequence", "Cross Sequence", - NULL, 2}, + NULL, 2, FALSE}, {"GammaCrossSequence", "Gamma Cross Sequence", "Gamma Cross Sequence", - NULL, 2}, + NULL, 2, FALSE}, {"GlowSequence", "Glow Sequence", "Sequence strip creating a glow effect", - rna_def_glow, 1}, + rna_def_glow, 1, FALSE}, {"MulticamSequence", "Multicam Select Sequence", "Sequence strip to perform multicam editing", - rna_def_multicam, 0}, + rna_def_multicam, 0, FALSE}, {"MultiplySequence", "Multiply Sequence", "Multiply Sequence", - NULL, 2}, + NULL, 2, FALSE}, {"OverDropSequence", "Over Drop Sequence", "Over Drop Sequence", - NULL, 2}, + NULL, 2, FALSE}, {"SpeedControlSequence", "SpeedControl Sequence", "Sequence strip to control the speed of other strips", - rna_def_speed_control, 1}, + rna_def_speed_control, 1, FALSE}, {"SubtractSequence", "Subtract Sequence", "Subtract Sequence", - NULL, 2}, + NULL, 2, FALSE}, {"TransformSequence", "Transform Sequence", "Sequence strip applying affine transformations to other strips", - rna_def_transform, 1}, + rna_def_transform, 1, FALSE}, {"WipeSequence", "Wipe Sequence", "Sequence strip creating a wipe transition", - rna_def_wipe, 1}, - {"", "", "", NULL, 0} + rna_def_wipe, 1, FALSE}, + {"", "", "", NULL, 0, FALSE} }; static void rna_def_effects(BlenderRNA *brna) @@ -1940,7 +1975,7 @@ static void rna_def_effects(BlenderRNA *brna) RNA_def_struct_ui_text(srna, effect->ui_name, effect->ui_desc); RNA_def_struct_sdna(srna, "Sequence"); - rna_def_effect_inputs(srna, effect->inputs); + rna_def_effect_inputs(srna, effect->inputs, effect->supports_mask); if (effect->func) effect->func(srna); |