diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2014-11-24 20:18:35 +0300 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2014-11-24 20:23:44 +0300 |
commit | 649a2bcc3d51cfc6f9fc237695015c87bcca7deb (patch) | |
tree | 4bea67033363027c40c3e78b2782d7df00e39558 /source/blender/editors/transform/transform.c | |
parent | aa0b268acbf352bdf69644bb11ee3b893008cc40 (diff) |
Politically correct terrible consequencer changes
This patch includes the work done in the terrible consequencer branch
that hasn't been merged to master minus a few controversial and WIP
stuff, like strip parenting, new sequence data structs and cuddly
widgets.
What is included:
* Strip extensions only when slipping. It can very easily be made an
option but with a few strips with overlapping durations it makes view
too crowded and difficult to make out.
* Threaded waveform loading + code that restores waveforms on undo (not
used though, since sound_load recreates everything. There's a patch for
review D876)
* Toggle to enable backdrop in the strip sequence editor
* Toggle to easily turn on/off waveform display
* Snapping during transform on sequence boundaries. Snapping to start or
end of selection depends on position of mouse when invoking the operator
* Snapping of timeline indicator in sequencer to strip boundaries. To
use just press and hold ctrl while dragging.
Reviewers: campbellbarton
Differential Revision: https://developer.blender.org/D904
Diffstat (limited to 'source/blender/editors/transform/transform.c')
-rw-r--r-- | source/blender/editors/transform/transform.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index ca971281420..7e27c11ec8a 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -7126,10 +7126,11 @@ static void headerSeqSlide(TransInfo *t, float val[2], char str[MAX_INFO_LEN]) WM_bool_as_string((t->flag & T_ALT_TRANSFORM) != 0)); } -static void applySeqSlideValue(TransInfo *t, const float val[2]) +static void applySeqSlideValue(TransInfo *t, const float val[2], int frame) { TransData *td = t->data; int i; + TransSeq *ts = t->customData; for (i = 0; i < t->total; i++, td++) { float tvec[2]; @@ -7144,15 +7145,21 @@ static void applySeqSlideValue(TransInfo *t, const float val[2]) mul_v2_fl(tvec, td->factor); - td->loc[0] = td->iloc[0] + tvec[0]; + if (t->modifiers & MOD_SNAP_INVERT) { + td->loc[0] = frame + td->factor * (td->iloc[0] - ts->min); + } + else { + td->loc[0] = td->iloc[0] + tvec[0]; + } + td->loc[1] = td->iloc[1] + tvec[1]; } } -static void applySeqSlide(TransInfo *t, const int UNUSED(mval[2])) +static void applySeqSlide(TransInfo *t, const int mval[2]) { char str[MAX_INFO_LEN]; - + int snap_frame = 0; if (t->con.mode & CON_APPLY) { float pvec[3] = {0.0f, 0.0f, 0.0f}; float tvec[3]; @@ -7160,7 +7167,8 @@ static void applySeqSlide(TransInfo *t, const int UNUSED(mval[2])) copy_v3_v3(t->values, tvec); } else { - snapGridIncrement(t, t->values); + snap_frame = snapSequenceBounds(t, mval); + // snapGridIncrement(t, t->values); applyNumInput(&t->num, t->values); } @@ -7168,7 +7176,7 @@ static void applySeqSlide(TransInfo *t, const int UNUSED(mval[2])) t->values[1] = floor(t->values[1] + 0.5f); headerSeqSlide(t, t->values, str); - applySeqSlideValue(t, t->values); + applySeqSlideValue(t, t->values, snap_frame); recalcData(t); |