diff options
author | Richard Antalik <richardantalik@gmail.com> | 2021-11-15 22:23:57 +0300 |
---|---|---|
committer | Richard Antalik <richardantalik@gmail.com> | 2021-11-15 22:23:57 +0300 |
commit | 7e148c45c89a7016f937aed90c399154546d8e9f (patch) | |
tree | 03b32252a937e706d8f909389f5a19a03125e535 /source/blender/sequencer/intern/strip_time.c | |
parent | d3c45e1c391eaafd9c54dba5b574b1a7ee23c82a (diff) |
Fix T90415: Missing cache invalidation
Some RNA properties and operators did not invalidate cache or did it
incorrectly.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D13101
Diffstat (limited to 'source/blender/sequencer/intern/strip_time.c')
-rw-r--r-- | source/blender/sequencer/intern/strip_time.c | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/source/blender/sequencer/intern/strip_time.c b/source/blender/sequencer/intern/strip_time.c index 92ac580f3b1..a8e07f37a0b 100644 --- a/source/blender/sequencer/intern/strip_time.c +++ b/source/blender/sequencer/intern/strip_time.c @@ -267,6 +267,65 @@ void SEQ_time_update_sequence(Scene *scene, ListBase *seqbase, Sequence *seq) seq_time_update_sequence_bounds(scene, seq); } +static bool update_changed_seq_recurs(Scene *scene, Sequence *seq, Sequence *changed_seq) +{ + Sequence *subseq; + bool do_update = false; + + /* recurse downwards to see if this seq depends on the changed seq */ + + if (seq == NULL) { + return false; + } + + if (seq == changed_seq) { + do_update = true; + } + + for (subseq = seq->seqbase.first; subseq; subseq = subseq->next) { + if (update_changed_seq_recurs(scene, subseq, changed_seq)) { + do_update = true; + } + } + + if (seq->seq1) { + if (update_changed_seq_recurs(scene, seq->seq1, changed_seq)) { + do_update = true; + } + } + if (seq->seq2 && (seq->seq2 != seq->seq1)) { + if (update_changed_seq_recurs(scene, seq->seq2, changed_seq)) { + do_update = true; + } + } + if (seq->seq3 && (seq->seq3 != seq->seq1) && (seq->seq3 != seq->seq2)) { + if (update_changed_seq_recurs(scene, seq->seq3, changed_seq)) { + do_update = true; + } + } + + if (do_update) { + ListBase *seqbase = SEQ_active_seqbase_get(SEQ_editing_get(scene)); + SEQ_time_update_sequence(scene, seqbase, seq); + } + + return do_update; +} + +void SEQ_time_update_recursive(Scene *scene, Sequence *changed_seq) +{ + Editing *ed = SEQ_editing_get(scene); + Sequence *seq; + + if (ed == NULL) { + return; + } + + for (seq = ed->seqbase.first; seq; seq = seq->next) { + update_changed_seq_recurs(scene, seq, changed_seq); + } +} + int SEQ_time_find_next_prev_edit(Scene *scene, int timeline_frame, const short side, |