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>2015-02-17 22:08:59 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-02-17 22:08:59 +0300
commit9d879c43f351a0a10fb7613fef1d0fe01a153f15 (patch)
tree384ae26329da43f482b675e33ca04e19ec6c6ff6 /source/blender/editors/transform
parent6133d14028673982d9d055119678c8ccd2dbb83c (diff)
Fix T43708: Wrong manipulator in individual origin
Manipulator and actual behavior were out-of-sync with a single edge selected.
Diffstat (limited to 'source/blender/editors/transform')
-rw-r--r--source/blender/editors/transform/transform_orientations.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c
index 79262396fb4..7fea8e163fd 100644
--- a/source/blender/editors/transform/transform_orientations.c
+++ b/source/blender/editors/transform/transform_orientations.c
@@ -718,14 +718,16 @@ 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;
- /* Logic explained:
+ float tvec[3];
+ /**
+ * Logic explained:
*
* - Edges and vert-pairs treated the same way.
- * - Point the Z axis along the edge vector (towards the active vertex).
- * - Point the Y axis outwards (the same direction as the normals).
+ * - Point the Y axis along the edge vector (towards the active vertex).
+ * - Point the Z axis outwards (the same direction as the normals).
*
- * Note that this is at odds a little with face select (and 3 vertices)
- * which point the Z axis along the normal, however in both cases Z is the dominant axis.
+ * \note Z points outwards - along the normal.
+ * take care making changes here, see: T38592, T43708
*/
/* be deterministic where possible and ensure v_pair[0] is active */
@@ -743,10 +745,15 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3],
SWAP(BMVert *, v_pair[0], v_pair[1]);
}
- add_v3_v3v3(plane, v_pair[0]->no, v_pair[1]->no);
- sub_v3_v3v3(normal, v_pair[0]->co, v_pair[1]->co);
+ add_v3_v3v3(normal, v_pair[0]->no, v_pair[1]->no);
+ 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;