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:
authorRichard Antalik <richardantalik@gmail.com>2021-07-26 15:55:14 +0300
committerRichard Antalik <richardantalik@gmail.com>2021-07-26 15:57:13 +0300
commit14f94fd1ca592bb532bbbfa9d65056fba955db17 (patch)
tree10417a43cd8e9be45856144481e5afaea0b07a50 /source/blender/sequencer
parent1b53fde9fc39c888ede7533f1cd55b028bb4bfad (diff)
VSE: Fix snapping bugs
Fix hold offset check causing missing snapping point when strip have only still frames. Fix effect strips of transformed strips causing snapping to prevoius strip positions. Reviewed By: mano-wii Differential Revision: https://developer.blender.org/D11948
Diffstat (limited to 'source/blender/sequencer')
-rw-r--r--source/blender/sequencer/SEQ_iterator.h2
-rw-r--r--source/blender/sequencer/intern/iterator.c32
2 files changed, 34 insertions, 0 deletions
diff --git a/source/blender/sequencer/SEQ_iterator.h b/source/blender/sequencer/SEQ_iterator.h
index e4c9f20f736..cb2091511a9 100644
--- a/source/blender/sequencer/SEQ_iterator.h
+++ b/source/blender/sequencer/SEQ_iterator.h
@@ -71,11 +71,13 @@ bool SEQ_iterator_ensure(SeqCollection *collection,
struct Sequence *SEQ_iterator_yield(SeqIterator *iterator);
SeqCollection *SEQ_collection_create(const char *name);
+SeqCollection *SEQ_collection_duplicate(SeqCollection *collection);
uint SEQ_collection_len(const SeqCollection *collection);
bool SEQ_collection_append_strip(struct Sequence *seq, SeqCollection *data);
bool SEQ_collection_remove_strip(struct Sequence *seq, SeqCollection *data);
void SEQ_collection_free(SeqCollection *collection);
void SEQ_collection_merge(SeqCollection *collection_dst, SeqCollection *collection_src);
+void SEQ_collection_exclude(SeqCollection *collection, SeqCollection *exclude_elements);
void SEQ_collection_expand(struct ListBase *seqbase,
SeqCollection *collection,
void query_func(struct Sequence *seq_reference,
diff --git a/source/blender/sequencer/intern/iterator.c b/source/blender/sequencer/intern/iterator.c
index 20a2ee3b183..09f033e70fb 100644
--- a/source/blender/sequencer/intern/iterator.c
+++ b/source/blender/sequencer/intern/iterator.c
@@ -184,6 +184,22 @@ void SEQ_collection_merge(SeqCollection *collection_dst, SeqCollection *collecti
}
/**
+ * Remove strips from collection that are also in `exclude_elements`. Source collection will be
+ * freed.
+ *
+ * \param collection: collection from which strips are removed
+ * \param exclude_elements: collection of strips to be removed
+ */
+void SEQ_collection_exclude(SeqCollection *collection, SeqCollection *exclude_elements)
+{
+ Sequence *seq;
+ SEQ_ITERATOR_FOREACH (seq, exclude_elements) {
+ SEQ_collection_remove_strip(seq, collection);
+ }
+ SEQ_collection_free(exclude_elements);
+}
+
+/**
* Expand collection by running SEQ_query() for each strip, which will be used as reference.
* Results of these queries will be merged into provided collection.
*
@@ -213,6 +229,22 @@ void SEQ_collection_expand(ListBase *seqbase,
}
}
+/**
+ * Duplicate collection
+ *
+ * \param collection: collection to be duplicated
+ * \return duplicate of collection
+ */
+SeqCollection *SEQ_collection_duplicate(SeqCollection *collection)
+{
+ SeqCollection *duplicate = SEQ_collection_create(__func__);
+ Sequence *seq;
+ SEQ_ITERATOR_FOREACH (seq, collection) {
+ SEQ_collection_append_strip(seq, duplicate);
+ }
+ return duplicate;
+}
+
/** \} */
/**