Fix vertex slide regression w/ rotated objects

This could only be done with certain rotations.
This commit is contained in:
Campbell Barton 2015-07-03 10:49:57 +10:00
parent 2b5e150db0
commit c702dabc3d
Notes: blender-bot 2023-02-14 08:55:40 +01:00
Referenced by issue #45312, Materials bug or Object bug when trying to color an object
1 changed files with 5 additions and 4 deletions

View File

@ -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);