Fix T89826: VSE snapping with constrained axis

Constraining to X axis caused snapping to not work at all. Constraining
to Y axis caused snapping indicator to be drawn, when snapping doesn't
occur.

Reviewed By: mano-wii

Differential Revision: https://developer.blender.org/D11898
This commit is contained in:
Richard Antalik 2021-07-14 13:22:40 +02:00
parent 5583d51773
commit 2761679180
Notes: blender-bot 2023-02-14 09:24:53 +01:00
Referenced by issue #89826, VSE's snap doesn't work when locking X axis
2 changed files with 6 additions and 1 deletions

View File

@ -129,7 +129,7 @@ static void applySeqSlide(TransInfo *t, const int UNUSED(mval[2]))
transform_convert_sequencer_channel_clamp(t, values_final);
if (t->con.mode & CON_APPLY) {
t->con.applyVec(t, NULL, NULL, t->values, values_final);
t->con.applyVec(t, NULL, NULL, values_final, values_final);
}
}

View File

@ -236,6 +236,11 @@ void transform_snap_sequencer_data_free(TransSeqSnapData *data)
bool transform_snap_sequencer_calc(TransInfo *t)
{
/* Prevent snapping when constrained to Y axis. */
if (t->con.mode & CON_APPLY && t->con.mode & CON_AXIS1) {
return false;
}
const TransSeqSnapData *snap_data = t->tsnap.seq_context;
int best_dist = MAXFRAME, best_target_frame = 0, best_source_frame = 0;