diff options
author | Kent Mein <mein@cs.umn.edu> | 2003-02-21 19:40:29 +0300 |
---|---|---|
committer | Kent Mein <mein@cs.umn.edu> | 2003-02-21 19:40:29 +0300 |
commit | 4afacdd9c3fdf20a9ef39f7c0f2ff203868e9179 (patch) | |
tree | e243f0cafe936d24f36311cdeeb0687449459f78 /source/blender | |
parent | 763da870b615419b52efe80cafa9a8e8cf32a303 (diff) |
Added Goofsters alt-m menu for merging verts while in edit mode menu.
Kent
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/src/edit.c | 56 | ||||
-rw-r--r-- | source/blender/src/space.c | 4 |
2 files changed, 59 insertions, 1 deletions
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; a<tottrans; a++, tv++) { + + if(event==1 || event==2) { /*Move all to Cursor*/ + + vec[0]= curs[0]-G.obedit->obmat[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) { |