Transform Snap: Fix normal in the wrong space.
authorGermano <germano.costa@ig.com.br>
Mon, 21 May 2018 14:05:34 +0000 (11:05 -0300)
committerGermano <germano.costa@ig.com.br>
Mon, 21 May 2018 14:05:34 +0000 (11:05 -0300)
source/blender/editors/transform/transform_snap_object.c

index fb49396132a0408b6388841ca595561fea16594b..5b75e0d54a6376568e9b98745cd6aa7976fc0be9 100644 (file)
@@ -1195,7 +1195,7 @@ static short snap_mesh_polygon(
                        invert_m4_m4(imat, obmat);
 
                        copy_v3_v3(r_no, nearest.no);
-                       mul_transposed_mat3_m4_v3(obmat, r_no);
+                       mul_transposed_mat3_m4_v3(imat, r_no);
                        normalize_v3(r_no);
                }
 
@@ -1297,7 +1297,7 @@ static short snap_mesh_edge_verts_mixed(
                        invert_m4_m4(imat, obmat);
 
                        copy_v3_v3(r_no, nearest.no);
-                       mul_transposed_mat3_m4_v3(obmat, r_no);
+                       mul_transposed_mat3_m4_v3(imat, r_no);
                        normalize_v3(r_no);
                }
 
@@ -1940,7 +1940,7 @@ static short snapMesh(
                        invert_m4_m4(imat, obmat);
 
                        copy_v3_v3(r_no, nearest.no);
-                       mul_transposed_mat3_m4_v3(obmat, r_no);
+                       mul_transposed_mat3_m4_v3(imat, r_no);
                        normalize_v3(r_no);
                }
                if (r_index) {
@@ -2082,7 +2082,7 @@ static short snapEditMesh(
                        invert_m4_m4(imat, obmat);
 
                        copy_v3_v3(r_no, nearest.no);
-                       mul_transposed_mat3_m4_v3(obmat, r_no);
+                       mul_transposed_mat3_m4_v3(imat, r_no);
                        normalize_v3(r_no);
                }
                if (r_index) {