From 1e5f4144b9c3ea62c98b527365a6201e97bfe193 Mon Sep 17 00:00:00 2001 From: Martin Poirier Date: Mon, 3 Mar 2008 19:57:48 +0000 Subject: [PATCH] [#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. --- source/blender/src/transform_orientations.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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)