From 4afacdd9c3fdf20a9ef39f7c0f2ff203868e9179 Mon Sep 17 00:00:00 2001 From: Kent Mein Date: Fri, 21 Feb 2003 16:40:29 +0000 Subject: Added Goofsters alt-m menu for merging verts while in edit mode menu. Kent --- source/blender/src/edit.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++ source/blender/src/space.c | 4 +++- 2 files changed, 59 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/src/edit.c b/source/blender/src/edit.c index ae29e73dc13..4e8ab587651 100644 --- a/source/blender/src/edit.c +++ b/source/blender/src/edit.c @@ -76,6 +76,8 @@ #include "BIF_space.h" #include "BIF_editview.h" #include "BIF_glutil.h" +#include "BIF_toolbox.h" +#include "BIF_editmesh.h" #include "BSE_view.h" #include "BSE_edit.h" @@ -836,3 +838,57 @@ void snapmenu() allqueue(REDRAWVIEW3D, 0); } } + +void mergemenu() { + extern TransVert *transvmain; + extern int tottrans; + extern float doublimit; + TransVert *tv; + float *curs, imat[3][3], bmat[3][3], vec[3]; + int a; + short event; + + event= pupmenu("MERGE %t|At Cursor%x1|Other Options Coming Soon!%x2"); + + curs= give_cursor(); + + if(event== 1 || event==2) { + +#ifdef __NLA + if ELEM5(G.obedit->type, OB_ARMATURE, OB_LATTICE, OB_MESH, OB_SURF, + OB_CURVE) make_trans_verts(bmat[0], bmat[1], 0); +#else + if ELEM4(G.obedit->type, OB_LATTICE, OB_MESH, OB_SURF, OB_CURVE) + make_trans_verts(bmat[0], bmat[1], 0); +#endif + if(tottrans==0) return; + + Mat3CpyMat4(bmat, G.obedit->obmat); + Mat3Inv(imat, bmat); + + tv= transvmain; + for(a=0; aobmat[3][0]; + vec[1]= curs[1]-G.obedit->obmat[3][1]; + vec[2]= curs[2]-G.obedit->obmat[3][2]; + } + Mat3MulVecfl(imat, vec); + VECCOPY(tv->loc, vec); + + } + MEM_freeN(transvmain); + transvmain= 0; + + if ELEM(G.obedit->type, OB_SURF, OB_CURVE) makeDispList(G.obedit); + + if (G.obedit->type == OB_ARMATURE) special_trans_update(0); + + notice("Removed: %d\n", removedoublesflag(1, doublimit)); + allqueue(REDRAWVIEW3D, 0); + return; + } +} + diff --git a/source/blender/src/space.c b/source/blender/src/space.c index fb31d498a64..6ce12f4ca8e 100644 --- a/source/blender/src/space.c +++ b/source/blender/src/space.c @@ -820,7 +820,9 @@ void winqread3d(unsigned short event, short val, char ascii) } break; case MKEY: - movetolayer(); + if((G.obedit) && (G.qual & LR_ALTKEY)) + mergemenu(); + else movetolayer(); break; case NKEY: if(G.obedit) { -- cgit v1.2.3