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 | |
parent | f379bb368bf57b97eb6b10a009ecb80cbc57159f (diff) | |
parent | de68880e792085aaef1372b023c70c363ed025d0 (diff) |
Merge branch 'blender-v2.90-release'
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_global.h | 23 | ||||
-rw-r--r-- | source/blender/blenkernel/BKE_sequencer.h | 7 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/sequencer.c | 41 |
3 files changed, 60 insertions, 11 deletions
diff --git a/source/blender/blenkernel/BKE_global.h b/source/blender/blenkernel/BKE_global.h index 61c270202f1..a356ad56994 100644 --- a/source/blender/blenkernel/BKE_global.h +++ b/source/blender/blenkernel/BKE_global.h @@ -145,18 +145,19 @@ enum { G_DEBUG_DEPSGRAPH_TIME = (1 << 11), /* depsgraph timing statistics and messages */ G_DEBUG_DEPSGRAPH_NO_THREADS = (1 << 12), /* single threaded depsgraph */ G_DEBUG_DEPSGRAPH_PRETTY = (1 << 13), /* use pretty colors in depsgraph messages */ + G_DEBUG_DEPSGRAPH_UUID = (1 << 14), /* use pretty colors in depsgraph messages */ G_DEBUG_DEPSGRAPH = (G_DEBUG_DEPSGRAPH_BUILD | G_DEBUG_DEPSGRAPH_EVAL | G_DEBUG_DEPSGRAPH_TAG | - G_DEBUG_DEPSGRAPH_TIME), - G_DEBUG_SIMDATA = (1 << 14), /* sim debug data display */ - G_DEBUG_GPU_MEM = (1 << 15), /* gpu memory in status bar */ - G_DEBUG_GPU = (1 << 16), /* gpu debug */ - G_DEBUG_IO = (1 << 17), /* IO Debugging (for Collada, ...)*/ - G_DEBUG_GPU_SHADERS = (1 << 18), /* GLSL shaders */ - G_DEBUG_GPU_FORCE_WORKAROUNDS = (1 << 19), /* force gpu workarounds bypassing detections. */ - G_DEBUG_XR = (1 << 20), /* XR/OpenXR messages */ - G_DEBUG_XR_TIME = (1 << 21), /* XR/OpenXR timing messages */ - - G_DEBUG_GHOST = (1 << 20), /* Debug GHOST module. */ + G_DEBUG_DEPSGRAPH_TIME | G_DEBUG_DEPSGRAPH_UUID), + G_DEBUG_SIMDATA = (1 << 15), /* sim debug data display */ + G_DEBUG_GPU_MEM = (1 << 16), /* gpu memory in status bar */ + G_DEBUG_GPU = (1 << 17), /* gpu debug */ + G_DEBUG_IO = (1 << 18), /* IO Debugging (for Collada, ...)*/ + G_DEBUG_GPU_SHADERS = (1 << 19), /* GLSL shaders */ + G_DEBUG_GPU_FORCE_WORKAROUNDS = (1 << 20), /* force gpu workarounds bypassing detections. */ + G_DEBUG_XR = (1 << 21), /* XR/OpenXR messages */ + G_DEBUG_XR_TIME = (1 << 22), /* XR/OpenXR timing messages */ + + G_DEBUG_GHOST = (1 << 23), /* Debug GHOST module. */ }; #define G_DEBUG_ALL \ diff --git a/source/blender/blenkernel/BKE_sequencer.h b/source/blender/blenkernel/BKE_sequencer.h index 2873a13d1f7..fd6885440fa 100644 --- a/source/blender/blenkernel/BKE_sequencer.h +++ b/source/blender/blenkernel/BKE_sequencer.h @@ -527,6 +527,9 @@ typedef struct Sequence *(*SeqLoadFn)(struct bContext *, ListBase *, struct SeqL struct Sequence *BKE_sequence_alloc(ListBase *lb, int cfra, int machine, int type); +/* Generate new UUID for the given sequence. */ +void BKE_sequence_session_uuid_generate(struct Sequence *sequence); + void BKE_sequence_alpha_mode_from_extension(struct Sequence *seq); void BKE_sequence_init_colorspace(struct Sequence *seq); @@ -630,6 +633,10 @@ void BKE_sequencer_flag_for_removal(struct Scene *scene, struct Sequence *seq); void BKE_sequencer_remove_flagged_sequences(struct Scene *scene, struct ListBase *seqbase); +/* A debug and development function which checks whether sequences have unique UUIDs. + * Errors will be reported to the console. */ +void BKE_sequencer_check_uuids_unique_and_report(const struct Scene *scene); + #ifdef __cplusplus } #endif 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); +} |