From 758307b9cc9f1e5eaf504d5c24090d08fb2bc14d Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 23 Feb 2007 20:06:17 +0000 Subject: [PATCH] Bug #6093: Spin tool now uses the 'clockwise' setting again. This was disabled because degrees accepts negative values, but it seems to cause confusion, and there's no reason both buttons can't work at the same time. --- source/blender/src/buttons_editing.c | 2 +- source/blender/src/editmesh_tools.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c index 94d294d2504..7aedce062ee 100644 --- a/source/blender/src/buttons_editing.c +++ b/source/blender/src/buttons_editing.c @@ -4139,7 +4139,7 @@ static void editing_panel_mesh_tools(Object *ob, Mesh *me) uiDefButS(block, NUM, B_DIFF, "Steps:", 110,55,100,19, &G.scene->toolsettings->step,1.0,180.0, 0, 0, "Specifies the total number of 'Spin' slices"); uiDefButS(block, NUM, B_DIFF, "Turns:", 210,55,115,19, &G.scene->toolsettings->turn,1.0,360.0, 0, 0, "Specifies the number of revolutions the screw turns"); uiDefButBitS(block, TOG, B_KEEPORIG, B_DIFF, "Keep Original",10,35,200,19, &G.scene->toolsettings->editbutflag, 0, 0, 0, 0, "Keeps a copy of the original vertices and faces after executing tools"); - uiDefButBitS(block, TOG, B_CLOCKWISE, B_DIFF, "Clockwise", 210,35,115,19, &G.scene->toolsettings->editbutflag, 0, 0, 0, 0, "Specifies the direction for 'Screw'"); + uiDefButBitS(block, TOG, B_CLOCKWISE, B_DIFF, "Clockwise", 210,35,115,19, &G.scene->toolsettings->editbutflag, 0, 0, 0, 0, "Specifies the direction for 'Screw' and 'Spin'"); uiBlockBeginAlign(block); uiDefBut(block, BUT,B_EXTREP, "Extrude Dup", 10,10,150,19, 0, 0, 0, 0, 0, "Creates copies of the selected vertices in a straight line away from the current viewport"); diff --git a/source/blender/src/editmesh_tools.c b/source/blender/src/editmesh_tools.c index 0f4c2ff1498..cfaab014135 100644 --- a/source/blender/src/editmesh_tools.c +++ b/source/blender/src/editmesh_tools.c @@ -751,8 +751,9 @@ void spin_mesh(int steps, float degr, float *dvec, int mode) cent[2]-= G.obedit->obmat[3][2]; Mat3MulVecfl(imat, cent); - phi= degr*M_PI/(-360.0); + phi= degr*M_PI/360.0; phi/= steps; + if(G.scene->toolsettings->editbutflag & B_CLOCKWISE) phi= -phi; if(dvec) { n[0]=n[1]= 0.0; @@ -819,7 +820,7 @@ void screw_mesh(int steps, int turns) EditMesh *em = G.editMesh; EditVert *eve,*v1=0,*v2=0; EditEdge *eed; - float dvec[3], nor[3],deg=(-360); + float dvec[3], nor[3]; TEST_EDITMESH if(multires_test()) return; @@ -878,9 +879,8 @@ void screw_mesh(int steps, int turns) dvec[1]= -dvec[1]; dvec[2]= -dvec[2]; } - if(G.scene->toolsettings->editbutflag & B_CLOCKWISE) deg= -deg; - spin_mesh(turns*steps, turns*deg, dvec, 0); + spin_mesh(turns*steps, turns*360, dvec, 0); BIF_undo_push("Spin"); }