Fix #133167: Scene snapping settings confilict with VSE

Enabling `use_snap_rotate` in 3D viewport caused rotation in sequencer
to apply snapping. Rotation snapping was using mixed snapping functions,
which aren't implemented in sequencer.

Ignore affect rotation/scale tool setting property and force increment
snapping to be used with these transform modes.

Pull Request: https://projects.blender.org/blender/blender/pulls/133272
This commit is contained in:
Richard Antalik
2025-01-19 20:56:56 +01:00
committed by Richard Antalik
parent 4f72b8b3ff
commit 30f3eaa2a5

View File

@@ -148,16 +148,12 @@ bool transform_snap_is_active(const TransInfo *t)
bool transformModeUseSnap(const TransInfo *t)
{
/* The animation editors should not depend on the snapping options of the 3D viewport. */
if (ELEM(t->spacetype, SPACE_ACTION, SPACE_GRAPH, SPACE_NLA)) {
/* The VSE and animation editors should not depend on the snapping options of the 3D viewport. */
if (ELEM(t->spacetype, SPACE_ACTION, SPACE_GRAPH, SPACE_NLA, SPACE_SEQ)) {
return true;
}
ToolSettings *ts = t->settings;
if (t->mode == TFM_TRANSLATION) {
/* VSE preview snapping should also not depend on the 3D viewport. */
if (t->spacetype == SPACE_SEQ) {
return true;
}
return (ts->snap_transform_mode_flag & SCE_SNAP_TRANSFORM_MODE_TRANSLATE) != 0;
}
if (t->mode == TFM_ROTATION) {
@@ -185,6 +181,11 @@ static bool doForceIncrementSnap(const TransInfo *t)
/* These spaces don't support increment snapping. */
return false;
}
if (t->spacetype == SPACE_SEQ && ELEM(t->mode, TFM_ROTATION, TFM_RESIZE)) {
return true;
}
if (t->modifiers & MOD_SNAP_FORCED) {
return false;
}