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>2018-09-07 04:24:37 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-09-07 04:25:54 +0300
commit7be3378d1620b1a8029b78425e3a64e2fcd6b210 (patch)
tree92bc994cf745ac86557455bf782f920a6f0a5fff /source/blender/editors/transform/transform_orientations.c
parenta5bb40170417acede168291eb81e3076a6cee077 (diff)
Fix normal transform orientation calculation
When using the 'normal' orientation, the normal would be ignored if the plane couldn't be calculated. Now use only the normal if the plane is zero length, this was already done, just not in all cases.
Diffstat (limited to 'source/blender/editors/transform/transform_orientations.c')
-rw-r--r--source/blender/editors/transform/transform_orientations.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c
index c38fb15fc89..1c5a6eabd6f 100644
--- a/source/blender/editors/transform/transform_orientations.c
+++ b/source/blender/editors/transform/transform_orientations.c
@@ -796,12 +796,7 @@ int getTransformOrientation_ex(const bContext *C, float normal[3], float plane[3
}
}
- if (is_zero_v3(plane)) {
- result = ORIENTATION_VERT;
- }
- else {
- result = ORIENTATION_EDGE;
- }
+ result = ORIENTATION_EDGE;
}
else if (em->bm->totvertsel > 3) {
BMIter iter;
@@ -1104,6 +1099,11 @@ void ED_getTransformOrientationMatrix(const bContext *C, float orientation_mat[3
type = getTransformOrientation_ex(C, normal, plane, around);
+ /* Fallback, when the plane can't be calculated. */
+ if (ORIENTATION_USE_PLANE(type) && is_zero_v3(plane)) {
+ type = ORIENTATION_VERT;
+ }
+
switch (type) {
case ORIENTATION_NORMAL:
if (createSpaceNormalTangent(orientation_mat, normal, plane) == 0) {