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-05-19 00:28:00 +0300
committerRichard Antalik <richardantalik@gmail.com>2021-05-19 00:41:47 +0300
commitf7a14c116c4de9a0ac2a07d7c6fa3097a018a668 (patch)
tree4ed17d176c10700f3b8e87276731ffa1fed80b38 /source/blender/sequencer/intern/iterator.c
parent748b5f025d74803e14364e4edb68f1c2c7ee5c99 (diff)
VSE: Move whole strip chain to meta
Python API function Sequence.move_to_meta() did delete effect chain when strip with effects was moved. Use iterator API to query effect strips and move whole chain to meta. Reviewed By: sergey Differential Revision: https://developer.blender.org/D11206
Diffstat (limited to 'source/blender/sequencer/intern/iterator.c')
-rw-r--r--source/blender/sequencer/intern/iterator.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/source/blender/sequencer/intern/iterator.c b/source/blender/sequencer/intern/iterator.c
index e49594f91f5..5225fc925e8 100644
--- a/source/blender/sequencer/intern/iterator.c
+++ b/source/blender/sequencer/intern/iterator.c
@@ -230,3 +230,42 @@ SeqCollection *SEQ_query_selected_strips(ListBase *seqbase)
}
return collection;
}
+
+/**
+ * Query all effect strips that are directly or indirectly connected to seq_reference.
+ * This includes all effects of seq_reference, strips used by another inputs and their effects, so
+ * that whole chain is fully independent of other strips.
+ *
+ * \param seq_reference: reference strip
+ * \param seqbase: ListBase in which strips are queried
+ * \param collection: collection to be filled
+ */
+void SEQ_query_strip_effect_chain(Sequence *seq_reference,
+ ListBase *seqbase,
+ SeqCollection *collection)
+{
+ if (!SEQ_collection_append_strip(seq_reference, collection)) {
+ return; /* Strip is already in set, so all effects connected to it are as well. */
+ }
+
+ /* Find all strips that seq_reference is connected to. */
+ if (seq_reference->type & SEQ_TYPE_EFFECT) {
+ if (seq_reference->seq1) {
+ SEQ_query_strip_effect_chain(seq_reference->seq1, seqbase, collection);
+ }
+ if (seq_reference->seq2) {
+ SEQ_query_strip_effect_chain(seq_reference->seq2, seqbase, collection);
+ }
+ if (seq_reference->seq3) {
+ SEQ_query_strip_effect_chain(seq_reference->seq3, seqbase, collection);
+ }
+ }
+
+ /* Find all strips connected to seq_reference. */
+ LISTBASE_FOREACH (Sequence *, seq_test, seqbase) {
+ if (seq_test->seq1 == seq_reference || seq_test->seq2 == seq_reference ||
+ seq_test->seq3 == seq_reference) {
+ SEQ_query_strip_effect_chain(seq_test, seqbase, collection);
+ }
+ }
+}