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-02-05 12:36:18 +0300
committerRichard Antalik <richardantalik@gmail.com>2021-02-05 12:40:35 +0300
commitf21b4e69b0ea98c3196246b0e4e4e97cd34c8e83 (patch)
tree833516d65e0395da93ff45a7b73b605a5f298adb /source/blender/editors/transform/transform_convert_sequencer.c
parentfa96aa581192a14aafcb8fd183e5aed2cb708c9c (diff)
Fix T82973: Strips overlap after transforming
When transforming multiple strips to limits of sequencer timeline they get squashed into one channel. Store selection minimum and maximum channel in TransSeq and limit transformation so no strip can be transformed beyond timeline boundary. Reviewed By: Sergey, mano-wii Differential Revision: https://developer.blender.org/D10013
Diffstat (limited to 'source/blender/editors/transform/transform_convert_sequencer.c')
-rw-r--r--source/blender/editors/transform/transform_convert_sequencer.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/source/blender/editors/transform/transform_convert_sequencer.c b/source/blender/editors/transform/transform_convert_sequencer.c
index ebb0b6823a3..7ec793f24bd 100644
--- a/source/blender/editors/transform/transform_convert_sequencer.c
+++ b/source/blender/editors/transform/transform_convert_sequencer.c
@@ -25,6 +25,7 @@
#include "MEM_guardedalloc.h"
+#include "BLI_listbase.h"
#include "BLI_math.h"
#include "BKE_context.h"
@@ -64,6 +65,8 @@ typedef struct TransSeq {
int min;
int max;
bool snap_left;
+ int selection_channel_range_min;
+ int selection_channel_range_max;
} TransSeq;
/* -------------------------------------------------------------------- */
@@ -623,6 +626,14 @@ void createTransSeqData(TransInfo *t)
}
}
+ ts->selection_channel_range_min = MAXSEQ + 1;
+ LISTBASE_FOREACH (Sequence *, seq, SEQ_active_seqbase_get(ed)) {
+ if ((seq->flag & SELECT) != 0) {
+ ts->selection_channel_range_min = min_ii(ts->selection_channel_range_min, seq->machine);
+ ts->selection_channel_range_max = max_ii(ts->selection_channel_range_max, seq->machine);
+ }
+ }
+
#undef XXX_DURIAN_ANIM_TX_HACK
}
@@ -850,6 +861,21 @@ void special_aftertrans_update__sequencer(bContext *UNUSED(C), TransInfo *t)
}
}
+void transform_convert_sequencer_channel_clamp(TransInfo *t)
+{
+ const TransSeq *ts = (TransSeq *)TRANS_DATA_CONTAINER_FIRST_SINGLE(t)->custom.type.data;
+ const int channel_offset = round_fl_to_int(t->values[1]);
+ const int min_channel_after_transform = ts->selection_channel_range_min + channel_offset;
+ const int max_channel_after_transform = ts->selection_channel_range_max + channel_offset;
+
+ if (max_channel_after_transform > MAXSEQ) {
+ t->values[1] -= max_channel_after_transform - MAXSEQ;
+ }
+ if (min_channel_after_transform < 1) {
+ t->values[1] -= min_channel_after_transform - 1;
+ }
+}
+
int transform_convert_sequencer_get_snap_bound(TransInfo *t)
{
TransSeq *ts = TRANS_DATA_CONTAINER_FIRST_SINGLE(t)->custom.type.data;