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:
authorCampbell Barton <ideasman42@gmail.com>2015-07-03 03:49:57 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-07-03 03:57:38 +0300
commitc702dabc3d388b546d57f1799cb1a3125c658658 (patch)
tree879a4e9249dc280b9bacfa581a8d11d256bbfb94
parent2b5e150db03a0e4e1c7e57274399123571fcc66d (diff)
Fix vertex slide regression w/ rotated objects
This could only be done with certain rotations.
-rw-r--r--source/blender/editors/transform/transform.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index ccd57db5959..66146ff1d71 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -6918,13 +6918,13 @@ static void calcVertSlideMouseActiveEdges(struct TransInfo *t, const int mval[2]
TransDataVertSlideVert *sv;
int i;
+ /* note: we could save a matrix-multiply for each vertex
+ * by finding the closest edge in local-space.
+ * However this skews the outcome with non-uniform-scale. */
+
/* first get the direction of the original mouse position */
sub_v2_v2v2(dir, imval_fl, mval_fl);
ED_view3d_win_to_delta(t->ar, dir, dir, t->zfac);
-
- invert_m4_m4(t->obedit->imat, t->obedit->obmat);
- mul_mat3_m4_v3(t->obedit->imat, dir);
-
normalize_v3(dir);
for (i = 0, sv = sld->sv; i < sld->totsv; i++, sv++) {
@@ -6938,6 +6938,7 @@ static void calcVertSlideMouseActiveEdges(struct TransInfo *t, const int mval[2]
float dir_dot;
sub_v3_v3v3(tdir, sv->co_orig_3d, sv->co_link_orig_3d[j]);
+ mul_mat3_m4_v3(t->obedit->obmat, tdir);
project_plane_v3_v3v3(tdir, tdir, t->viewinv[2]);
normalize_v3(tdir);