diff options
-rw-r--r-- | source/blender/src/space.c | 57 | ||||
-rwxr-xr-x | source/blender/src/transform.c | 20 | ||||
-rw-r--r-- | source/blender/src/transform_manipulator.c | 20 |
3 files changed, 53 insertions, 44 deletions
diff --git a/source/blender/src/space.c b/source/blender/src/space.c index 469643a85e3..3f796a79ff9 100644 --- a/source/blender/src/space.c +++ b/source/blender/src/space.c @@ -713,6 +713,7 @@ void BIF_undo_menu(void) static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt) { + static short prev_event= 0; // used to detect an alt/ctrl/shift event unsigned short event= evt->event; short val= evt->val; char ascii= evt->ascii; @@ -725,6 +726,8 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt) if(val) { + prev_event= event; // for ctrl/alt/shift event + if( uiDoBlocks(&curarea->uiblocks, event)!=UI_NOTHING ) event= 0; if(event==MOUSEY || event==MOUSEX) return; @@ -1217,13 +1220,6 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt) clear_object('g'); } } else if((G.qual==0)) { - if(v3d->twflag & V3D_USE_MANIPULATOR) { - if((v3d->twtype & V3D_MANIPULATOR_TRANSLATE)==0) { - v3d->twtype= V3D_MANIPULATOR_TRANSLATE; - doredraw= 1; - break; - } - } #ifdef NEWTRANSFORM Transform(TFM_TRANSLATION); #else @@ -1490,13 +1486,6 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt) loopoperations(LOOP_CUT); } else if((G.qual==0)) { - if(v3d->twflag & V3D_USE_MANIPULATOR) { - if((v3d->twtype & V3D_MANIPULATOR_ROTATE)==0) { - v3d->twtype= V3D_MANIPULATOR_ROTATE; - doredraw= 1; - break; - } - } #ifdef NEWTRANSFORM Transform(TFM_ROTATION); #else @@ -1505,13 +1494,6 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt) } } else if((G.qual==0)) { - if(v3d->twflag & V3D_USE_MANIPULATOR) { - if((v3d->twtype & V3D_MANIPULATOR_ROTATE)==0) { - v3d->twtype= V3D_MANIPULATOR_ROTATE; - doredraw= 1; - break; - } - } #ifdef NEWTRANSFORM Transform(TFM_ROTATION); #else @@ -1538,13 +1520,6 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt) else if(G.qual==LR_SHIFTKEY) snapmenu(); else if(G.qual==0) { - if(v3d->twflag & V3D_USE_MANIPULATOR) { - if((v3d->twtype & V3D_MANIPULATOR_SCALE)==0) { - v3d->twtype= V3D_MANIPULATOR_SCALE; - doredraw= 1; - break; - } - } #ifdef NEWTRANSFORM Transform(TFM_RESIZE); #else @@ -1567,13 +1542,6 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt) snapmenu(); } else if((G.qual==0)) { - if(v3d->twflag & V3D_USE_MANIPULATOR) { - if((v3d->twtype & V3D_MANIPULATOR_SCALE)==0) { - v3d->twtype= V3D_MANIPULATOR_SCALE; - doredraw= 1; - break; - } - } #ifdef NEWTRANSFORM Transform(TFM_RESIZE); #else @@ -1825,6 +1793,25 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt) } } } + else { // val==0, hotkeys for ctrl/alt/shift + if(prev_event==event) { + switch(event) { + + case RIGHTCTRLKEY: + case LEFTCTRLKEY: + if(v3d->twflag & V3D_USE_MANIPULATOR) { + if(v3d->twtype & V3D_MANIPULATOR_TRANSLATE) + v3d->twtype= V3D_MANIPULATOR_ROTATE; + else if(v3d->twtype & V3D_MANIPULATOR_ROTATE) + v3d->twtype= V3D_MANIPULATOR_SCALE; + else if(v3d->twtype & V3D_MANIPULATOR_SCALE) + v3d->twtype= V3D_MANIPULATOR_TRANSLATE; + doredraw= 1; + } + break; + } + } + } if(doredraw) { scrarea_queue_winredraw(curarea); diff --git a/source/blender/src/transform.c b/source/blender/src/transform.c index dff4bc38ffe..f82bd9a9fc5 100755 --- a/source/blender/src/transform.c +++ b/source/blender/src/transform.c @@ -1664,6 +1664,26 @@ void ManipulatorTransform(int mode) ret_val = TRANS_CONFIRM; break; } + if(val) { + switch(event) { + case WHEELDOWNMOUSE: + case PADPLUSKEY: + if(G.f & G_PROPORTIONAL) { + Trans.propsize*= 1.1f; + calculatePropRatio(&Trans); + Trans.redraw= 1; + } + break; + case WHEELUPMOUSE: + case PADMINUS: + if(G.f & G_PROPORTIONAL) { + Trans.propsize*= 0.90909090f; + calculatePropRatio(&Trans); + Trans.redraw= 1; + } + break; + } + } } } diff --git a/source/blender/src/transform_manipulator.c b/source/blender/src/transform_manipulator.c index b3a127be625..b01533aebc6 100644 --- a/source/blender/src/transform_manipulator.c +++ b/source/blender/src/transform_manipulator.c @@ -1384,15 +1384,17 @@ int BIF_do_manipulator(ScrArea *sa) /* cycling orientation modus */ getmouseco_areawin(mval); - if(mvalo[0]==mval[0] && mvalo[1]==mval[1]) { - if(v3d->twmode==V3D_MANIPULATOR_GLOBAL) - v3d->twmode= V3D_MANIPULATOR_LOCAL; - else if(v3d->twmode==V3D_MANIPULATOR_LOCAL) - if(G.obedit || G.obpose) v3d->twmode= V3D_MANIPULATOR_NORMAL; - else v3d->twmode= V3D_MANIPULATOR_GLOBAL; - else if(v3d->twmode==V3D_MANIPULATOR_NORMAL) - v3d->twmode= V3D_MANIPULATOR_GLOBAL; - + if(val==MAN_ROT_V || val==MAN_SCALE_C || val==MAN_TRANS_C) { + if(mvalo[0]==mval[0] && mvalo[1]==mval[1]) { + if(v3d->twmode==V3D_MANIPULATOR_GLOBAL) + v3d->twmode= V3D_MANIPULATOR_LOCAL; + else if(v3d->twmode==V3D_MANIPULATOR_LOCAL) + if(G.obedit || G.obpose) v3d->twmode= V3D_MANIPULATOR_NORMAL; + else v3d->twmode= V3D_MANIPULATOR_GLOBAL; + else if(v3d->twmode==V3D_MANIPULATOR_NORMAL) + v3d->twmode= V3D_MANIPULATOR_GLOBAL; + + } } } |