[Bf-blender-cvs] [c702dab] master: Fix vertex slide regression w/ rotated objects
Campbell Barton
noreply at git.blender.org
Fri Jul 3 03:28:11 CEST 2015
Commit: c702dabc3d388b546d57f1799cb1a3125c658658
Author: Campbell Barton
Date: Fri Jul 3 10:49:57 2015 +1000
Branches: master
https://developer.blender.org/rBc702dabc3d388b546d57f1799cb1a3125c658658
Fix vertex slide regression w/ rotated objects
This could only be done with certain rotations.
===================================================================
M source/blender/editors/transform/transform.c
===================================================================
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index ccd57db..66146ff 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);
More information about the Bf-blender-cvs
mailing list