diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2020-07-31 12:53:22 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2020-07-31 12:53:22 +0300 |
commit | db24e289b25e6110265110aa4bf3009541e9fae9 (patch) | |
tree | e4d9b4eeecbbc18b4163b0e85ee33327989c0910 /source/blender/depsgraph | |
parent | f379bb368bf57b97eb6b10a009ecb80cbc57159f (diff) | |
parent | de68880e792085aaef1372b023c70c363ed025d0 (diff) |
Merge branch 'blender-v2.90-release'
Diffstat (limited to 'source/blender/depsgraph')
3 files changed, 17 insertions, 23 deletions
diff --git a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc index 82cb311ec45..9956391a2d7 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc +++ b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc @@ -311,6 +311,10 @@ bool scene_copy_inplace_no_main(const Scene *scene, Scene *new_scene) { const ID *id_for_copy = &scene->id; + if (G.debug & G_DEBUG_DEPSGRAPH_UUID) { + BKE_sequencer_check_uuids_unique_and_report(scene); + } + #ifdef NESTED_ID_NASTY_WORKAROUND NestedIDHackTempStorage id_hack_storage; id_for_copy = nested_id_hack_get_discarded_pointers(&id_hack_storage, &scene->id); @@ -481,25 +485,6 @@ void scene_setup_view_layers_after_remap(const Depsgraph *depsgraph, * Still not an excuse to have those. */ } -void update_sequence_orig_pointers(const ListBase *sequences_orig, ListBase *sequences_cow) -{ - Sequence *sequence_orig = reinterpret_cast<Sequence *>(sequences_orig->first); - Sequence *sequence_cow = reinterpret_cast<Sequence *>(sequences_cow->first); - while (sequence_orig != nullptr) { - update_sequence_orig_pointers(&sequence_orig->seqbase, &sequence_cow->seqbase); - sequence_cow->orig_sequence = sequence_orig; - sequence_cow = sequence_cow->next; - sequence_orig = sequence_orig->next; - } -} - -void update_scene_orig_pointers(const Scene *scene_orig, Scene *scene_cow) -{ - if (scene_orig->ed != nullptr) { - update_sequence_orig_pointers(&scene_orig->ed->seqbase, &scene_cow->ed->seqbase); - } -} - /* Check whether given ID is expanded or still a shallow copy. */ inline bool check_datablock_expanded(const ID *id_cow) { @@ -812,7 +797,6 @@ void update_id_after_copy(const Depsgraph *depsgraph, scene_cow->toolsettings = scene_orig->toolsettings; scene_cow->eevee.light_cache_data = scene_orig->eevee.light_cache_data; scene_setup_view_layers_after_remap(depsgraph, id_node, reinterpret_cast<Scene *>(id_cow)); - update_scene_orig_pointers(scene_orig, scene_cow); break; } default: diff --git a/source/blender/depsgraph/intern/eval/deg_eval_runtime_backup_sequencer.cc b/source/blender/depsgraph/intern/eval/deg_eval_runtime_backup_sequencer.cc index 2780938fe05..ba7d20c0ba8 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval_runtime_backup_sequencer.cc +++ b/source/blender/depsgraph/intern/eval/deg_eval_runtime_backup_sequencer.cc @@ -26,6 +26,8 @@ #include "DNA_scene_types.h" #include "DNA_sequence_types.h" +#include "BLI_assert.h" + #include "BKE_sequencer.h" #include "BKE_sound.h" @@ -43,7 +45,9 @@ void SequencerBackup::init_from_scene(Scene *scene) SequenceBackup sequence_backup(depsgraph); sequence_backup.init_from_sequence(sequence); if (!sequence_backup.isEmpty()) { - sequences_backup.add(sequence->orig_sequence, sequence_backup); + const SessionUUID &session_uuid = sequence->runtime.session_uuid; + BLI_assert(BLI_session_uuid_is_generated(&session_uuid)); + sequences_backup.add(session_uuid, sequence_backup); } } SEQ_END; @@ -53,7 +57,9 @@ void SequencerBackup::restore_to_scene(Scene *scene) { Sequence *sequence; SEQ_BEGIN (scene->ed, sequence) { - SequenceBackup *sequence_backup = sequences_backup.lookup_ptr(sequence->orig_sequence); + const SessionUUID &session_uuid = sequence->runtime.session_uuid; + BLI_assert(BLI_session_uuid_is_generated(&session_uuid)); + SequenceBackup *sequence_backup = sequences_backup.lookup_ptr(session_uuid); if (sequence_backup != nullptr) { sequence_backup->restore_to_sequence(sequence); } diff --git a/source/blender/depsgraph/intern/eval/deg_eval_runtime_backup_sequencer.h b/source/blender/depsgraph/intern/eval/deg_eval_runtime_backup_sequencer.h index 9fe38ec270c..4419238da32 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval_runtime_backup_sequencer.h +++ b/source/blender/depsgraph/intern/eval/deg_eval_runtime_backup_sequencer.h @@ -23,6 +23,10 @@ #pragma once +#include "DNA_session_uuid_types.h" + +#include "BLI_session_uuid.h" + #include "intern/depsgraph_type.h" #include "intern/eval/deg_eval_runtime_backup_sequence.h" @@ -43,7 +47,7 @@ class SequencerBackup { const Depsgraph *depsgraph; - Map<Sequence *, SequenceBackup> sequences_backup; + Map<SessionUUID, SequenceBackup> sequences_backup; }; } // namespace deg |