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:
authorRichard Antalik <richardantalik@gmail.com>2021-11-15 22:23:57 +0300
committerRichard Antalik <richardantalik@gmail.com>2021-11-15 22:23:57 +0300
commit7e148c45c89a7016f937aed90c399154546d8e9f (patch)
tree03b32252a937e706d8f909389f5a19a03125e535 /source/blender/sequencer
parentd3c45e1c391eaafd9c54dba5b574b1a7ee23c82a (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')
-rw-r--r--source/blender/sequencer/SEQ_relations.h4
-rw-r--r--source/blender/sequencer/SEQ_time.h1
-rw-r--r--source/blender/sequencer/intern/strip_add.c2
-rw-r--r--source/blender/sequencer/intern/strip_relations.c74
-rw-r--r--source/blender/sequencer/intern/strip_time.c59
5 files changed, 61 insertions, 79 deletions
diff --git a/source/blender/sequencer/SEQ_relations.h b/source/blender/sequencer/SEQ_relations.h
index 54e53193b48..3b9d430a3c9 100644
--- a/source/blender/sequencer/SEQ_relations.h
+++ b/source/blender/sequencer/SEQ_relations.h
@@ -35,10 +35,6 @@ struct Scene;
struct Sequence;
void SEQ_relations_sequence_free_anim(struct Sequence *seq);
-void SEQ_relations_update_changed_seq_and_deps(struct Scene *scene,
- struct Sequence *changed_seq,
- int len_change,
- int ibuf_change);
bool SEQ_relations_check_scene_recursion(struct Scene *scene, struct ReportList *reports);
bool SEQ_relations_render_loop_check(struct Sequence *seq_main, struct Sequence *seq);
void SEQ_relations_free_imbuf(struct Scene *scene, struct ListBase *seqbasep, bool for_render);
diff --git a/source/blender/sequencer/SEQ_time.h b/source/blender/sequencer/SEQ_time.h
index df3c9a40409..a0abaf8813a 100644
--- a/source/blender/sequencer/SEQ_time.h
+++ b/source/blender/sequencer/SEQ_time.h
@@ -45,6 +45,7 @@ int SEQ_time_find_next_prev_edit(struct Scene *scene,
const bool do_center,
const bool do_unselected);
void SEQ_time_update_sequence(struct Scene *scene, struct ListBase *seqbase, struct Sequence *seq);
+void SEQ_time_update_recursive(struct Scene *scene, struct Sequence *changed_seq);
bool SEQ_time_strip_intersects_frame(const struct Sequence *seq, const int timeline_frame);
void SEQ_time_update_meta_strip_range(struct Scene *scene, struct Sequence *seq_meta);
diff --git a/source/blender/sequencer/intern/strip_add.c b/source/blender/sequencer/intern/strip_add.c
index 6f635b5db5f..70ac2620e20 100644
--- a/source/blender/sequencer/intern/strip_add.c
+++ b/source/blender/sequencer/intern/strip_add.c
@@ -248,7 +248,6 @@ Sequence *SEQ_add_effect_strip(Scene *scene, ListBase *seqbase, struct SeqLoadDa
SEQ_transform_set_right_handle_frame(seq, load_data->effect.end_frame);
}
- SEQ_relations_update_changed_seq_and_deps(scene, seq, 1, 1); /* Runs SEQ_time_update_sequence. */
seq_add_set_name(scene, seq, load_data);
seq_add_generic_update(scene, seqbase, seq);
@@ -798,6 +797,7 @@ void SEQ_add_reload_new_file(Main *bmain, Scene *scene, Sequence *seq, const boo
ListBase *seqbase = SEQ_active_seqbase_get(SEQ_editing_get(scene));
SEQ_time_update_sequence(scene, seqbase, seq);
+ SEQ_relations_invalidate_cache_raw(scene, seq);
}
void SEQ_add_movie_reload_if_needed(struct Main *bmain,
diff --git a/source/blender/sequencer/intern/strip_relations.c b/source/blender/sequencer/intern/strip_relations.c
index d17a37cb9d8..e6d9cd330b3 100644
--- a/source/blender/sequencer/intern/strip_relations.c
+++ b/source/blender/sequencer/intern/strip_relations.c
@@ -281,80 +281,6 @@ void SEQ_relations_free_imbuf(Scene *scene, ListBase *seqbase, bool for_render)
}
}
-static bool update_changed_seq_recurs(
- Scene *scene, Sequence *seq, Sequence *changed_seq, int len_change, int ibuf_change)
-{
- Sequence *subseq;
- bool free_imbuf = false;
-
- /* recurse downwards to see if this seq depends on the changed seq */
-
- if (seq == NULL) {
- return false;
- }
-
- if (seq == changed_seq) {
- free_imbuf = true;
- }
-
- for (subseq = seq->seqbase.first; subseq; subseq = subseq->next) {
- if (update_changed_seq_recurs(scene, subseq, changed_seq, len_change, ibuf_change)) {
- free_imbuf = true;
- }
- }
-
- if (seq->seq1) {
- if (update_changed_seq_recurs(scene, seq->seq1, changed_seq, len_change, ibuf_change)) {
- free_imbuf = true;
- }
- }
- if (seq->seq2 && (seq->seq2 != seq->seq1)) {
- if (update_changed_seq_recurs(scene, seq->seq2, changed_seq, len_change, ibuf_change)) {
- free_imbuf = true;
- }
- }
- if (seq->seq3 && (seq->seq3 != seq->seq1) && (seq->seq3 != seq->seq2)) {
- if (update_changed_seq_recurs(scene, seq->seq3, changed_seq, len_change, ibuf_change)) {
- free_imbuf = true;
- }
- }
-
- if (free_imbuf) {
- if (ibuf_change) {
- if (seq->type == SEQ_TYPE_MOVIE) {
- SEQ_relations_sequence_free_anim(seq);
- }
- else if (seq->type == SEQ_TYPE_SPEED) {
- seq_effect_speed_rebuild_map(scene, seq);
- }
- }
-
- if (len_change) {
- ListBase *seqbase = SEQ_active_seqbase_get(SEQ_editing_get(scene));
- SEQ_time_update_sequence(scene, seqbase, seq);
- }
- }
-
- return free_imbuf;
-}
-
-void SEQ_relations_update_changed_seq_and_deps(Scene *scene,
- Sequence *changed_seq,
- int len_change,
- int ibuf_change)
-{
- 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, len_change, ibuf_change);
- }
-}
-
static void sequencer_all_free_anim_ibufs(ListBase *seqbase, int timeline_frame)
{
for (Sequence *seq = seqbase->first; seq != NULL; seq = seq->next) {
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,