- Removed temporal hack that switched manipulator type on G, R, S hotkeys.
That was blocking immediate hotkey access for normal blendering. - New, experimental, hotkey to switch: CTRLKEY! Added code in such a way it detects a CTRL key press and release without using it as modifier. Pressing CTRL will cycle through the 3 manipulator types. - Fix for yesterday's commit; click on centerpoint for switching orientation happened too on a click for other widgets. Not nice...
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1384,6 +1384,7 @@ int BIF_do_manipulator(ScrArea *sa)
|
||||
|
||||
/* cycling orientation modus */
|
||||
getmouseco_areawin(mval);
|
||||
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;
|
||||
@@ -1394,6 +1395,7 @@ int BIF_do_manipulator(ScrArea *sa)
|
||||
v3d->twmode= V3D_MANIPULATOR_GLOBAL;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Gval= 0xFFFF;
|
||||
|
||||
Reference in New Issue
Block a user