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/blenkernel/intern | |
parent | f379bb368bf57b97eb6b10a009ecb80cbc57159f (diff) | |
parent | de68880e792085aaef1372b023c70c363ed025d0 (diff) |
Merge branch 'blender-v2.90-release'
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/sequencer.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index b16fc08a4af..fbd6d970e5f 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -46,6 +46,7 @@ #include "BLI_listbase.h" #include "BLI_math.h" #include "BLI_path_util.h" +#include "BLI_session_uuid.h" #include "BLI_string.h" #include "BLI_string_utf8.h" #include "BLI_threads.h" @@ -5352,9 +5353,16 @@ Sequence *BKE_sequence_alloc(ListBase *lb, int cfra, int machine, int type) seq->stereo3d_format = MEM_callocN(sizeof(Stereo3dFormat), "Sequence Stereo Format"); seq->cache_flag = SEQ_CACHE_STORE_RAW | SEQ_CACHE_STORE_PREPROCESSED | SEQ_CACHE_STORE_COMPOSITE; + BKE_sequence_session_uuid_generate(seq); + return seq; } +void BKE_sequence_session_uuid_generate(struct Sequence *sequence) +{ + sequence->runtime.session_uuid = BLI_session_uuid_generate(); +} + void BKE_sequence_alpha_mode_from_extension(Sequence *seq) { if (seq->strip && seq->strip->stripdata) { @@ -5664,6 +5672,10 @@ static Sequence *seq_dupli(const Scene *scene_src, { Sequence *seqn = MEM_dupallocN(seq); + if ((flag & LIB_ID_CREATE_NO_MAIN) == 0) { + BKE_sequence_session_uuid_generate(seq); + } + seq->tmp = seqn; seqn->strip = MEM_dupallocN(seq->strip); @@ -6127,3 +6139,32 @@ void BKE_sequencer_remove_flagged_sequences(Scene *scene, ListBase *seqbase) } } } + +void BKE_sequencer_check_uuids_unique_and_report(const Scene *scene) +{ + if (scene->ed == NULL) { + return; + } + + struct GSet *used_uuids = BLI_gset_new( + BLI_session_uuid_ghash_hash, BLI_session_uuid_ghash_compare, "sequencer used uuids"); + + const Sequence *sequence; + SEQ_BEGIN (scene->ed, sequence) { + const SessionUUID *session_uuid = &sequence->runtime.session_uuid; + if (!BLI_session_uuid_is_generated(session_uuid)) { + printf("Sequence %s does not have UUID generated.\n", sequence->name); + continue; + } + + if (BLI_gset_lookup(used_uuids, session_uuid) != NULL) { + printf("Sequence %s has duplicate UUID generated.\n", sequence->name); + continue; + } + + BLI_gset_insert(used_uuids, (void *)session_uuid); + } + SEQ_END; + + BLI_gset_free(used_uuids, NULL); +} |