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:
authorBastien Montagne <montagne29@wanadoo.fr>2015-08-13 13:45:13 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2015-08-13 13:45:13 +0300
commitc62eb919ec11617387f7842ef190e9be6359fec2 (patch)
treebec32d1a6ca0aeef7b907b93796e66577d831373 /source/blender/editors/transform
parent487d2cb4f321d9847fb18bd57fbe7ccc3528461f (diff)
Fix T45775: Bad 'Normal' transform space for edge of non-uniformed scaled object.
Non-uniform scaled obmat will lead to transformation not preserving angles, so we must ensure our normal is orthogonal to the edge **after** applying obmat.
Diffstat (limited to 'source/blender/editors/transform')
-rw-r--r--source/blender/editors/transform/transform_orientations.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c
index 7fea8e163fd..c49e8675b50 100644
--- a/source/blender/editors/transform/transform_orientations.c
+++ b/source/blender/editors/transform/transform_orientations.c
@@ -718,7 +718,6 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3],
/* should never fail */
if (LIKELY(v_pair[0] && v_pair[1])) {
bool v_pair_swap = false;
- float tvec[3];
/**
* Logic explained:
*
@@ -749,11 +748,6 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3],
sub_v3_v3v3(plane, v_pair[0]->co, v_pair[1]->co);
/* flip the plane normal so we point outwards */
negate_v3(plane);
-
- /* align normal to edge direction (so normal is perpendicular to the plane).
- * 'ORIENTATION_EDGE' will do the other way around */
- project_v3_v3v3(tvec, normal, plane);
- sub_v3_v3(normal, tvec);
}
result = ORIENTATION_EDGE;
@@ -962,8 +956,16 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3],
/* Vectors from edges don't need the special transpose inverse multiplication */
if (result == ORIENTATION_EDGE) {
+ float tvec[3];
+
mul_mat3_m4_v3(ob->obmat, normal);
mul_mat3_m4_v3(ob->obmat, plane);
+
+ /* align normal to edge direction (so normal is perpendicular to the plane).
+ * 'ORIENTATION_EDGE' will do the other way around.
+ * This has to be done **after** applying obmat, see T45775! */
+ project_v3_v3v3(tvec, normal, plane);
+ sub_v3_v3(normal, tvec);
}
else {
mul_m3_v3(mat, normal);