Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2020-07-30 15:53:42 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2020-07-31 12:45:40 +0300
commit9ea6228b07efe4fcefdfb5de83a66308a73ce923 (patch)
treeb730facb0c734c6dea024e2177c64a4416fe8dc7 /source/blender/editors/space_sequencer
parenteb8cbb6d7c73fa349ab335cfc7bac8b8f6a845d5 (diff)
Sequencer: Ensure UUIDs are updated when needed
Document cases where it seems that they need to be updated, but where the proper behavior is to not update the UUID.
Diffstat (limited to 'source/blender/editors/space_sequencer')
-rw-r--r--source/blender/editors/space_sequencer/sequencer_edit.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c
index 3fbc31d5240..fe851aa16c8 100644
--- a/source/blender/editors/space_sequencer/sequencer_edit.c
+++ b/source/blender/editors/space_sequencer/sequencer_edit.c
@@ -2543,7 +2543,8 @@ static int sequencer_add_duplicate_exec(bContext *C, wmOperator *UNUSED(op))
if (nseqbase.first) {
Sequence *seq = nseqbase.first;
- /* Rely on the nseqbase list being added at the end. */
+ /* Rely on the nseqbase list being added at the end.
+ * Their UUIDs has been re-generated by the BKE_sequence_base_dupli_recursive(), */
BLI_movelisttolist(ed->seqbasep, &nseqbase);
for (; seq; seq = seq->next) {
@@ -2956,6 +2957,7 @@ static int sequencer_meta_make_exec(bContext *C, wmOperator *op)
if (seq != seqm && (seq->flag & SELECT)) {
BKE_sequence_invalidate_cache_composite(scene, seq);
channel_max = max_ii(seq->machine, channel_max);
+ /* Sequence is moved within the same edit, no need to re-generate the UUID. */
BLI_remlink(ed->seqbasep, seq);
BLI_addtail(&seqm->seqbase, seq);
}
@@ -3032,6 +3034,9 @@ static int sequencer_meta_separate_exec(bContext *C, wmOperator *UNUSED(op))
BKE_sequence_invalidate_cache_composite(scene, seq);
}
+ /* This moves strips from meta to parent, sating within same edit and no new strips are
+ * allocated. If the UUID was unique already (as it should) it will stay unique. Nn need to
+ * re-generate the UUIDs.*/
BLI_movelisttolist(ed->seqbasep, &last_seq->seqbase);
BLI_listbase_clear(&last_seq->seqbase);
@@ -3371,8 +3376,15 @@ static int sequencer_copy_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
- BKE_sequence_base_dupli_recursive(
- scene, scene, &seqbase_clipboard, ed->seqbasep, 0, LIB_ID_CREATE_NO_USER_REFCOUNT);
+ /* NOTE: The UUID is re-generated on paste, so we can keep UUID in the clipboard since
+ * nobody can reach them anyway.
+ * This reduces chance or running out of UUIDs if a cat falls asleep on Ctrl-C. */
+ BKE_sequence_base_dupli_recursive(scene,
+ scene,
+ &seqbase_clipboard,
+ ed->seqbasep,
+ 0,
+ (LIB_ID_CREATE_NO_USER_REFCOUNT | LIB_ID_FREE_NO_MAIN));
seqbase_clipboard_frame = scene->r.cfra;
@@ -3430,6 +3442,8 @@ static int sequencer_paste_exec(bContext *C, wmOperator *UNUSED(op))
iseq_first = nseqbase.first;
+ /* NOTE: BKE_sequence_base_dupli_recursive() takes care of generating new UUIDs for sequences
+ * in the new list. */
BLI_movelisttolist(ed->seqbasep, &nseqbase);
for (iseq = iseq_first; iseq; iseq = iseq->next) {