diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2020-07-30 13:23:37 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2020-07-31 12:44:59 +0300 |
commit | cc63897c2275dc78af7a82684dde37282b3aa876 (patch) | |
tree | 7d05964e741a7a46a40cccae1969888b75ee96be /source/blender/blenkernel/intern | |
parent | 3305a94fa1d80259651c776e088ec9c6a6f64e44 (diff) |
Sequencer: Add session UUID check function
Is aimed for use during development and debug, to help
verifying that operations do not leave sequences with
invalid UUIDs.
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/sequencer.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 57295805e97..1be330ee2ef 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -6081,3 +6081,32 @@ bool BKE_sequencer_render_loop_check(Sequence *seq_main, Sequence *seq) return false; } + +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); +} |