diff options
author | Ton Roosendaal <ton@blender.org> | 2005-05-07 19:50:09 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2005-05-07 19:50:09 +0400 |
commit | 9a41ac4f70fb85490d0c4e259ba1873a4fd1c5dd (patch) | |
tree | f6b616c501569e365507bbd52d4e930db14520b5 /source/blender/src/transform_manipulator.c | |
parent | 71c2d1e9d6bf38e41e77981dd4eef88d44cca4fa (diff) |
Patch from Tom Musgrove to bypass extrude popup on singular selections...
Implementation had some issues though, since:
a) Blender has no stats available that tells amount of selected edges
b) Bypassing the popup should be 100% accurate
b) Once you do that, the popup should actually only show possible
choices as well.
So! I've added a G.totedge and G.totedgesel, also being printed in the
info header. Using this variable the extrude popups could be limited too.
Also: made 'normal alignment' for edge-only selections work when the
normal wasn't pointing OK. Now it aligns the Z axis with the edge itself
Exact algorithm for choosing a 'normal' and 'plane' still is weak.
Diffstat (limited to 'source/blender/src/transform_manipulator.c')
-rw-r--r-- | source/blender/src/transform_manipulator.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/source/blender/src/transform_manipulator.c b/source/blender/src/transform_manipulator.c index 4cb7263582e..7e4f324f5ae 100644 --- a/source/blender/src/transform_manipulator.c +++ b/source/blender/src/transform_manipulator.c @@ -187,38 +187,40 @@ int calc_manipulator_stats(ScrArea *sa) EditMesh *em = G.editMesh; EditVert *eve; float vec[3]; - int do_norm= 0; + int no_faces= 1; if(v3d->twmode == V3D_MANIP_NORMAL) { EditFace *efa; for(efa= em->faces.first; efa; efa= efa->next) { if(efa->f & SELECT) { + no_faces= 1; VECADD(normal, normal, efa->n); VecSubf(vec, efa->v2->co, efa->v1->co); VECADD(plane, plane, vec); } } - if(normal[0]==0.0 && normal[1]==0.0 && normal[2]==0.0) do_norm= 1; } /* do vertices for center, and if still no normal found, use vertex normals */ for(eve= em->verts.first; eve; eve= eve->next) { if(eve->f & SELECT) { - if(do_norm) VECADD(normal, normal, eve->no); + if(no_faces) VECADD(normal, normal, eve->no); totsel++; calc_tw_center(eve->co); } } /* the edge case... */ - if(do_norm && v3d->twmode == V3D_MANIP_NORMAL) { + if(no_faces && v3d->twmode == V3D_MANIP_NORMAL) { EditEdge *eed; for(eed= em->edges.first; eed; eed= eed->next) { if(eed->f & SELECT) { - VecSubf(vec, eed->v2->co, eed->v1->co); - VECADD(plane, plane, vec); + /* ok we got an edge, only use one, and as normal */ + VECCOPY(plane, normal); + VecSubf(normal, eed->v2->co, eed->v1->co); + break; } } } |