diff options
author | Martin Poirier <theeth@yahoo.com> | 2008-03-03 22:57:48 +0300 |
---|---|---|
committer | Martin Poirier <theeth@yahoo.com> | 2008-03-03 22:57:48 +0300 |
commit | 1e5f4144b9c3ea62c98b527365a6201e97bfe193 (patch) | |
tree | 904225a35e7598daf8ce588f2764c8433226356f /source/blender/src/transform_orientations.c | |
parent | 156d24646242a442cda1f53a1df8d4b9d4eea966 (diff) |
[#8434] Normal manipultor does not align with normals (like in 2.45)
Bring back multivert normal average for the normal manipulator/orientation.
When selecting more than three vertice, the averaged normal of all selected is used to get orientation Z-axis.
NOTE: This is only applicable when NO faces are selected, otherwise it uses the averaged normal of the faces (excluding vertice that aren't part of a face). This is not new behavior
CHANGES FROM 2.45: Selecting 2 or 3 vertice doesn't use normal averaging but uses virtual edge and face orientations instead.
Diffstat (limited to 'source/blender/src/transform_orientations.c')
-rw-r--r-- | source/blender/src/transform_orientations.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/src/transform_orientations.c b/source/blender/src/transform_orientations.c index ecc25b40f47..1502ea70582 100644 --- a/source/blender/src/transform_orientations.c +++ b/source/blender/src/transform_orientations.c @@ -509,6 +509,19 @@ int getTransformOrientation(float normal[3], float plane[3], int activeOnly) } result = ORIENTATION_VERT; } + else if (G.totvertsel > 3) + { + normal[0] = normal[1] = normal[2] = 0; + + for (eve = em->verts.first; eve; eve = eve->next) + { + if ( eve->f & SELECT ) { + VecAddf(normal, normal, eve->no); + } + } + Normalize(normal); + result = ORIENTATION_VERT; + } } } /* end editmesh */ else if ELEM3(G.obedit->type, OB_CURVE, OB_SURF, OB_FONT) |