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
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')
-rw-r--r--source/blender/editors/transform/transform_convert.h2
-rw-r--r--source/blender/editors/transform/transform_convert_sequencer.c26
-rw-r--r--source/blender/editors/transform/transform_mode_edge_seq_slide.c3
3 files changed, 30 insertions, 1 deletions
diff --git a/source/blender/editors/transform/transform_convert.h b/source/blender/editors/transform/transform_convert.h
index be4322b42e2..a1c7a6a39a6 100644
--- a/source/blender/editors/transform/transform_convert.h
+++ b/source/blender/editors/transform/transform_convert.h
@@ -49,7 +49,7 @@ void mesh_customdatacorrect_init(TransInfo *t);
/* transform_convert_sequencer.c */
int transform_convert_sequencer_get_snap_bound(TransInfo *t);
-
+void transform_convert_sequencer_channel_clamp(TransInfo *t);
/********************* intern **********************/
typedef enum eTransConvertType {
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;
diff --git a/source/blender/editors/transform/transform_mode_edge_seq_slide.c b/source/blender/editors/transform/transform_mode_edge_seq_slide.c
index b21f00eed98..4330d5e79be 100644
--- a/source/blender/editors/transform/transform_mode_edge_seq_slide.c
+++ b/source/blender/editors/transform/transform_mode_edge_seq_slide.c
@@ -35,10 +35,12 @@
#include "WM_types.h"
#include "UI_interface.h"
+#include "UI_view2d.h"
#include "BLT_translation.h"
#include "transform.h"
+#include "transform_convert.h"
#include "transform_mode.h"
#include "transform_snap.h"
@@ -106,6 +108,7 @@ static void applySeqSlide(TransInfo *t, const int mval[2])
float values_final[3] = {0.0f};
snapSequenceBounds(t, mval);
+ transform_convert_sequencer_channel_clamp(t);
if (applyNumInput(&t->num, values_final)) {
if (t->con.mode & CON_APPLY) {
if (t->con.mode & CON_AXIS0) {