diff options
author | Richard Antalik <richardantalik@gmail.com> | 2020-04-12 23:27:28 +0300 |
---|---|---|
committer | Richard Antalik <richardantalik@gmail.com> | 2020-04-12 23:27:28 +0300 |
commit | 5081556bb517961f513e6874b4040ab8e623f1d7 (patch) | |
tree | 93f4d057b0c118a852119356ad1cf24c14cd69dd /source | |
parent | 5cabf1301a50906bdda391255696e8a85b6b555b (diff) |
Fix T75415: Changing text strip "start" leads to flickering image
Cache must be invalidated before and after transformation,
so all frames are properly invalidated.
This also fixes wrong invalidated type, composite is enough here.
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D7341
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/makesrna/intern/rna_sequencer.c | 56 |
1 files changed, 53 insertions, 3 deletions
diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c index 04729f87cab..f486456bd38 100644 --- a/source/blender/makesrna/intern/rna_sequencer.c +++ b/source/blender/makesrna/intern/rna_sequencer.c @@ -291,7 +291,6 @@ static void rna_Sequence_frame_change_update(Main *bmain, Scene *UNUSED(scene), { Scene *scene = (Scene *)ptr->owner_id; do_sequence_frame_change_update(scene, (Sequence *)ptr->data); - rna_Sequence_invalidate_preprocessed_update(bmain, scene, ptr); } static void rna_Sequence_start_frame_set(PointerRNA *ptr, int value) @@ -299,8 +298,10 @@ static void rna_Sequence_start_frame_set(PointerRNA *ptr, int value) Sequence *seq = (Sequence *)ptr->data; Scene *scene = (Scene *)ptr->owner_id; + BKE_sequence_invalidate_cache_composite(scene, seq); BKE_sequence_translate(scene, seq, value - seq->start); do_sequence_frame_change_update(scene, seq); + BKE_sequence_invalidate_cache_composite(scene, seq); } static void rna_Sequence_start_frame_final_set(PointerRNA *ptr, int value) @@ -308,9 +309,11 @@ static void rna_Sequence_start_frame_final_set(PointerRNA *ptr, int value) Sequence *seq = (Sequence *)ptr->data; Scene *scene = (Scene *)ptr->owner_id; + BKE_sequence_invalidate_cache_composite(scene, seq); BKE_sequence_tx_set_final_left(seq, value); BKE_sequence_single_fix(seq); do_sequence_frame_change_update(scene, seq); + BKE_sequence_invalidate_cache_composite(scene, seq); } static void rna_Sequence_end_frame_final_set(PointerRNA *ptr, int value) @@ -318,9 +321,47 @@ static void rna_Sequence_end_frame_final_set(PointerRNA *ptr, int value) Sequence *seq = (Sequence *)ptr->data; Scene *scene = (Scene *)ptr->owner_id; + BKE_sequence_invalidate_cache_composite(scene, seq); BKE_sequence_tx_set_final_right(seq, value); BKE_sequence_single_fix(seq); do_sequence_frame_change_update(scene, seq); + BKE_sequence_invalidate_cache_composite(scene, seq); +} + +static void rna_Sequence_frame_offset_start_set(PointerRNA *ptr, int value) +{ + Sequence *seq = (Sequence *)ptr->data; + Scene *scene = (Scene *)ptr->owner_id; + + BKE_sequence_invalidate_cache_composite(scene, seq); + seq->startofs = value; +} + +static void rna_Sequence_frame_offset_end_set(PointerRNA *ptr, int value) +{ + Sequence *seq = (Sequence *)ptr->data; + Scene *scene = (Scene *)ptr->owner_id; + + BKE_sequence_invalidate_cache_composite(scene, seq); + seq->endofs = value; +} + +static void rna_Sequence_frame_still_start_set(PointerRNA *ptr, int value) +{ + Sequence *seq = (Sequence *)ptr->data; + Scene *scene = (Scene *)ptr->owner_id; + + BKE_sequence_invalidate_cache_composite(scene, seq); + seq->startstill = value; +} + +static void rna_Sequence_frame_still_end_set(PointerRNA *ptr, int value) +{ + Sequence *seq = (Sequence *)ptr->data; + Scene *scene = (Scene *)ptr->owner_id; + + BKE_sequence_invalidate_cache_composite(scene, seq); + seq->endstill = value; } static void rna_Sequence_anim_startofs_final_set(PointerRNA *ptr, int value) @@ -350,8 +391,10 @@ static void rna_Sequence_frame_length_set(PointerRNA *ptr, int value) Sequence *seq = (Sequence *)ptr->data; Scene *scene = (Scene *)ptr->owner_id; + BKE_sequence_invalidate_cache_composite(scene, seq); BKE_sequence_tx_set_final_right(seq, BKE_sequence_tx_get_final_left(seq, false) + value); do_sequence_frame_change_update(scene, seq); + BKE_sequence_invalidate_cache_composite(scene, seq); } static int rna_Sequence_frame_length_get(PointerRNA *ptr) @@ -374,6 +417,7 @@ static void rna_Sequence_channel_set(PointerRNA *ptr, int value) Editing *ed = BKE_sequencer_editing_get(scene, false); ListBase *seqbase = BKE_sequence_seqbase(&ed->seqbase, seq); + BKE_sequence_invalidate_cache_composite(scene, seq); /* check channel increment or decrement */ const int channel_delta = (value >= seq->machine) ? 1 : -1; seq->machine = value; @@ -383,6 +427,7 @@ static void rna_Sequence_channel_set(PointerRNA *ptr, int value) BKE_sequence_base_shuffle_ex(seqbase, seq, scene, channel_delta); } BKE_sequencer_sort(scene); + BKE_sequence_invalidate_cache_composite(scene, seq); } static void rna_Sequence_frame_offset_range( @@ -1627,6 +1672,7 @@ static void rna_def_sequence(BlenderRNA *brna) RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, NULL); /* strip positioning */ + /* Cache has to be invalidated before and after transformation. */ prop = RNA_def_property(srna, "frame_final_duration", PROP_INT, PROP_TIME); RNA_def_property_range(prop, 1, MAXFRAME); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); @@ -1684,14 +1730,16 @@ static void rna_def_sequence(BlenderRNA *brna) RNA_def_property_int_sdna(prop, NULL, "startofs"); // RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* overlap tests */ RNA_def_property_ui_text(prop, "Start Offset", ""); - RNA_def_property_int_funcs(prop, NULL, NULL, "rna_Sequence_frame_offset_range"); + RNA_def_property_int_funcs( + prop, NULL, "rna_Sequence_frame_offset_start_set", "rna_Sequence_frame_offset_range"); RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_frame_change_update"); prop = RNA_def_property(srna, "frame_offset_end", PROP_INT, PROP_TIME); RNA_def_property_int_sdna(prop, NULL, "endofs"); // RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* overlap tests */ RNA_def_property_ui_text(prop, "End Offset", ""); - RNA_def_property_int_funcs(prop, NULL, NULL, "rna_Sequence_frame_offset_range"); + RNA_def_property_int_funcs( + prop, NULL, "rna_Sequence_frame_offset_end_set", "rna_Sequence_frame_offset_range"); RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_frame_change_update"); prop = RNA_def_property(srna, "frame_still_start", PROP_INT, PROP_TIME); @@ -1699,6 +1747,7 @@ static void rna_def_sequence(BlenderRNA *brna) // RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* overlap tests */ RNA_def_property_range(prop, 0, MAXFRAME); RNA_def_property_ui_text(prop, "Start Still", ""); + RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_frame_still_start_set", NULL); RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_frame_change_update"); prop = RNA_def_property(srna, "frame_still_end", PROP_INT, PROP_TIME); @@ -1706,6 +1755,7 @@ static void rna_def_sequence(BlenderRNA *brna) // RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* overlap tests */ RNA_def_property_range(prop, 0, MAXFRAME); RNA_def_property_ui_text(prop, "End Still", ""); + RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_frame_still_end_set", NULL); RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_frame_change_update"); prop = RNA_def_property(srna, "channel", PROP_INT, PROP_UNSIGNED); |