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:
authorGermano Cavalcante <germano.costa@ig.com.br>2020-06-22 15:07:51 +0300
committerGermano Cavalcante <germano.costa@ig.com.br>2020-06-22 15:08:02 +0300
commite2fc9a88bcb328284e5eab4934a9b8cc8200d55e (patch)
tree6f0089a7881b18280d8cc10cf505d9c0876f44b3 /source/blender/editors/transform/transform_snap.c
parent85c6f0b472ed246841c3153ce984f2dff8312ead (diff)
Transform: Full snapping support for Vert Slide
Now all options for "snap to" affect the Vert Slide mode. Reviewed By: campbellbarton Maniphest Tasks: T66426 Differential Revision: https://developer.blender.org/D3440
Diffstat (limited to 'source/blender/editors/transform/transform_snap.c')
-rw-r--r--source/blender/editors/transform/transform_snap.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c
index 3afdc5a21c0..a9b3b7448ef 100644
--- a/source/blender/editors/transform/transform_snap.c
+++ b/source/blender/editors/transform/transform_snap.c
@@ -124,6 +124,9 @@ bool transformModeUseSnap(const TransInfo *t)
if (t->mode == TFM_RESIZE) {
return (ts->snap_transform_mode_flag & SCE_SNAP_TRANSFORM_MODE_SCALE) != 0;
}
+ if (t->mode == TFM_VERT_SLIDE) {
+ return true;
+ }
return false;
}
@@ -1540,3 +1543,14 @@ static void applyGridIncrement(
}
/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name Generic callbacks
+ * \{ */
+
+float transform_snap_distance_len_squared_fn(TransInfo *UNUSED(t), const float p1[3], const float p2[3])
+{
+ return len_squared_v3v3(p1, p2);
+}
+
+/** \} */