From 7e148c45c89a7016f937aed90c399154546d8e9f Mon Sep 17 00:00:00 2001 From: Richard Antalik Date: Mon, 15 Nov 2021 20:23:57 +0100 Subject: 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 --- source/blender/sequencer/intern/strip_time.c | 59 ++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) (limited to 'source/blender/sequencer/intern/strip_time.c') 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, -- cgit v1.2.3