Some random small stuff packed in one commit:
- Moved a couple of undo_push_mesh after the action has been confirmed (mainly bevel, merge and mirror) - Split mirror in two functions, interface and functionality - Simplified the code of the merge function
This commit is contained in:
@@ -1180,22 +1180,18 @@ void mergemenu(void)
|
||||
|
||||
event = pupmenu("MERGE %t|At Center%x1|At Cursor%x2");
|
||||
|
||||
switch (event) {
|
||||
if (event==-1) return; /* Return if the menu is closed without any choices */
|
||||
|
||||
undo_push_mesh("Merge"); /* The action has been confirmed, push the mesh down the undo pipe */
|
||||
|
||||
if (event==1)
|
||||
snap_to_center(); /*Merge at Center*/
|
||||
else
|
||||
snap_sel_to_curs(); /*Merge at Cursor*/
|
||||
|
||||
case 1: /*Merge at center of selection*/
|
||||
snap_to_center();
|
||||
notice("Removed: %d", removedoublesflag(1, doublimit));
|
||||
allqueue(REDRAWVIEW3D, 0);
|
||||
countall();
|
||||
break;
|
||||
case 2: /*Merge at Cursor*/
|
||||
snap_sel_to_curs();
|
||||
notice("Removed: %d", removedoublesflag(1, doublimit));
|
||||
allqueue(REDRAWVIEW3D, 0);
|
||||
countall();
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void delete_context_selected(void) {
|
||||
|
||||
@@ -7742,6 +7742,7 @@ void undo_menu_mesh(void)
|
||||
}
|
||||
|
||||
/******************* BEVEL CODE STARTS HERE ********************/
|
||||
|
||||
void bevel_displace_vec(float *midvec, float *v1, float *v2, float *v3, float d, float no[3])
|
||||
{
|
||||
float a[3], c[3], n_a[3], n_c[3], mid[3], ac, ac2, fac;
|
||||
@@ -8147,7 +8148,9 @@ void bevel_mesh(float bsize, int allfaces)
|
||||
/* tag all faces for shrink*/
|
||||
evl= G.edvl.first;
|
||||
while (evl) {
|
||||
if (vlakselectedAND(evl, 1)||allfaces) evl->f1= 2;
|
||||
if (vlakselectedAND(evl, 1)||allfaces) {
|
||||
evl->f1= 2;
|
||||
}
|
||||
evl= evl->next;
|
||||
}
|
||||
|
||||
@@ -8524,6 +8527,7 @@ void bevel_menu()
|
||||
}
|
||||
}
|
||||
if (Canceled==0) {
|
||||
undo_push_mesh("Bevel");
|
||||
bevel_mesh_recurs(drawd/fac, recurs, 1);
|
||||
righthandfaces(1);
|
||||
}
|
||||
|
||||
@@ -1577,7 +1577,6 @@ void special_editmenu(void)
|
||||
subdivideflag(1, 0.0, editbutflag | B_SMOOTH);
|
||||
break;
|
||||
case 4:
|
||||
undo_push_mesh("Merge");
|
||||
mergemenu();
|
||||
break;
|
||||
case 5:
|
||||
@@ -1602,7 +1601,6 @@ void special_editmenu(void)
|
||||
vertexsmooth();
|
||||
break;
|
||||
case 11:
|
||||
undo_push_mesh("Bevel");
|
||||
bevel_menu();
|
||||
break;
|
||||
}
|
||||
@@ -6751,19 +6749,14 @@ void make_displists_by_obdata(void *obdata) {
|
||||
/* ******************************************************************** */
|
||||
/* Mirror function in Edit Mode */
|
||||
|
||||
|
||||
void mirrormenu(void){
|
||||
short mode = 0, axis, a;
|
||||
void mirror(short mode) {
|
||||
short axis, a;
|
||||
float mat[3][3], imat[3][3], min[3], max[3];
|
||||
TransVert *tv;
|
||||
mode=pupmenu("Mirror Axis %t|Global X%x1| Y%x2| Z%x3|Local X%x4| Y%x5| Z%x6|View X%x7| Y%x8| Z%x9|");
|
||||
|
||||
if (G.obedit==0) return;
|
||||
if (mode==-1) return;
|
||||
|
||||
make_trans_verts(min, max, 0);
|
||||
Mat3CpyMat4(mat, G.obedit->obmat);
|
||||
// Inverting the matrix explicitly, since a 4x4 inverse is not always the same
|
||||
// Inverting the matrix explicitly, since the inverse is not always correct (then why the heck are we keeping it!)
|
||||
Mat3Inv(imat, mat);
|
||||
|
||||
tv = transvmain;
|
||||
@@ -6832,7 +6825,7 @@ void mirrormenu(void){
|
||||
float viewmat[3][3], iviewmat[3][3];
|
||||
|
||||
Mat3CpyMat4(viewmat, G.vd->viewmat);
|
||||
// Inverting the matrix explicitly, since a 4x4 inverse is not always the same
|
||||
// Inverting the matrix explicitly
|
||||
Mat3Inv(iviewmat, viewmat);
|
||||
|
||||
// axis is mode with an offset
|
||||
@@ -6883,3 +6876,18 @@ void mirrormenu(void){
|
||||
|
||||
tottrans= 0;
|
||||
}
|
||||
|
||||
void mirrormenu(void){
|
||||
short mode = 0;
|
||||
|
||||
if (G.obedit==0) return;
|
||||
|
||||
mode=pupmenu("Mirror Axis %t|Global X%x1| Y%x2| Z%x3|Local X%x4| Y%x5| Z%x6|View X%x7| Y%x8| Z%x9|");
|
||||
|
||||
if (mode==-1) return; /* return */
|
||||
|
||||
if(G.obedit->type==OB_MESH) undo_push_mesh("Mirror"); /* If it's a mesh, push it down the undo pipe */
|
||||
|
||||
mirror(mode); /* separating functionality from interface | call*/
|
||||
}
|
||||
|
||||
|
||||
@@ -1130,21 +1130,13 @@ void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
||||
if(G.obedit){
|
||||
if(G.qual==LR_ALTKEY) {
|
||||
if(G.obedit->type==OB_MESH) {
|
||||
undo_push_mesh("Merge");
|
||||
mergemenu();
|
||||
|
||||
makeDispList(G.obedit);
|
||||
}
|
||||
}
|
||||
else if((G.qual==0)) {
|
||||
if(G.obedit->type==OB_MESH) {
|
||||
undo_push_mesh("Mirror");
|
||||
mirrormenu();
|
||||
}
|
||||
else {
|
||||
mirrormenu();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if((G.qual==0)){
|
||||
movetolayer();
|
||||
|
||||
Reference in New Issue
Block a user