diff options
author | Richard Antalik <ISS> | 2020-04-12 23:09:46 +0300 |
---|---|---|
committer | Richard Antalik <richardantalik@gmail.com> | 2020-04-12 23:10:13 +0300 |
commit | 77ca5ab6b02bbccc97d13c50d4174afe9471725a (patch) | |
tree | d750e8cab574fcf3bf6934b378fdf061d3a489a5 /source/blender/blenkernel | |
parent | 5b79e0b80e49c1f75736a8b0bdeb8560a934b072 (diff) |
Fix T74897: VSE animation doesn't work
`seq_free_animdata()` removes fcurve pointers belonging to strips from
`Scene` CoW datablock's `AnimData` during `BKE_scene_graph_update_for_newframe`.
This causes problems with updating animation.
This worked before rBbe2e41c397ba, because `AnimData` was freed by `BKE_animdata_free()`
before `seq_free_animdata()` was executed, so it had no data to operate on and returned
on precondition `if (scene->adt == NULL || scene->adt->action == NULL)`
Reviewed By: mont29, brecht
Maniphest Tasks: T74897
Differential Revision: https://developer.blender.org/D7264
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_sequencer.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/sequencer.c | 16 |
2 files changed, 11 insertions, 7 deletions
diff --git a/source/blender/blenkernel/BKE_sequencer.h b/source/blender/blenkernel/BKE_sequencer.h index 1b4ca1350ad..dd9414b81f7 100644 --- a/source/blender/blenkernel/BKE_sequencer.h +++ b/source/blender/blenkernel/BKE_sequencer.h @@ -265,7 +265,7 @@ void BKE_sequencer_base_clipboard_pointers_free(struct ListBase *seqbase); void BKE_sequencer_base_clipboard_pointers_store(struct Main *bmain, struct ListBase *seqbase); void BKE_sequencer_base_clipboard_pointers_restore(struct ListBase *seqbase, struct Main *bmain); -void BKE_sequence_free(struct Scene *scene, struct Sequence *seq); +void BKE_sequence_free(struct Scene *scene, struct Sequence *seq, const bool do_clean_animdata); void BKE_sequence_free_anim(struct Sequence *seq); const char *BKE_sequence_give_name(struct Sequence *seq); ListBase *BKE_sequence_seqbase_get(struct Sequence *seq, int *r_offset); diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 1cc7f4afa49..7d4e5e582c6 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -236,7 +236,8 @@ static void seq_free_strip(Strip *strip) static void BKE_sequence_free_ex(Scene *scene, Sequence *seq, const bool do_cache, - const bool do_id_user) + const bool do_id_user, + const bool do_clean_animdata) { if (seq->strip) { seq_free_strip(seq->strip); @@ -271,7 +272,10 @@ static void BKE_sequence_free_ex(Scene *scene, BKE_sound_remove_scene_sound(scene, seq->scene_sound); } - seq_free_animdata(scene, seq); + /* XXX This must not be done in BKE code. */ + if (do_clean_animdata) { + seq_free_animdata(scene, seq); + } } if (seq->prop) { @@ -299,9 +303,9 @@ static void BKE_sequence_free_ex(Scene *scene, MEM_freeN(seq); } -void BKE_sequence_free(Scene *scene, Sequence *seq) +void BKE_sequence_free(Scene *scene, Sequence *seq, const bool do_clean_animdata) { - BKE_sequence_free_ex(scene, seq, true, true); + BKE_sequence_free_ex(scene, seq, true, true, do_clean_animdata); } /* Function to free imbuf and anim data on changes */ @@ -331,7 +335,7 @@ static void seq_free_sequence_recurse(Scene *scene, Sequence *seq, const bool do seq_free_sequence_recurse(scene, iseq, do_id_user); } - BKE_sequence_free_ex(scene, seq, false, do_id_user); + BKE_sequence_free_ex(scene, seq, false, do_id_user, true); } Editing *BKE_sequencer_editing_get(Scene *scene, bool alloc) @@ -501,7 +505,7 @@ void BKE_sequencer_editing_free(Scene *scene, const bool do_id_user) SEQ_BEGIN (ed, seq) { /* handle cache freeing above */ - BKE_sequence_free_ex(scene, seq, false, do_id_user); + BKE_sequence_free_ex(scene, seq, false, do_id_user, false); } SEQ_END; |