forked from bartvdbraak/blender
Nathanael Law's fix to make numerical input more compatible with axis constraints.
I thought this was a nice addition, so I'm commiting it. To Ton for easier changelog creation: When constraining to an axis, numerical input is limited (and will switch automaticly) to that axis. Original e-mail ------------------------------- I was playing with the axis constraints for grab and scale transforms and I thought that the behavior was slightly illogical. Without axis constraints, I think everything is great, but once a constraint is used some irregularities show up. (Note, this is not a bug, it's more of a possible improvement) When you enter grab or scale mode, then constrain the transformation to a particular axis, then enter numeric entry mode by hitting a number or 'n', there is no reason for you to try and edit the numeric value of a non-constrained axis which is the current behavior. E.g. You grab an object and want to move it along the z-axis, so you enter grab mode and either hit 'z' or the middle mouse button and you move the mouse to get an idea of how it looks. You decide that you want to use a value of +4.2 with numeric entry; now you have to enter the following sequence: 'g', 'z', 'move mouse', 'tab', 'tab', '4.2', 'enter'. However, you're already constrained to the z-axis, so you should not have to enter 'tab', 'tab'. The included patch changes the behavior of grab and scale transforms so that if you are constrained to an axis, and enter numeric entry mode via 'n' or by hitting a number, you will immediately begin editing the appropriate axis, and will not have to hit 'tab'. This may not seem like a big improvement (because it's not), but I feel that it improves the workflow of a commonly used task slightly and does not negatively impact any other aspects of the program. I welcome feedback on this idea. -- - Nathanael Law <njlaw@xyrodian.com>
This commit is contained in:
parent
8c570d4bb4
commit
ed67092601
@ -5097,6 +5097,13 @@ void transform(int mode)
|
|||||||
else{
|
else{
|
||||||
axismode= XTRANS;
|
axismode= XTRANS;
|
||||||
}
|
}
|
||||||
|
if (mode == 'g') {
|
||||||
|
if (axismode & XTRANS)
|
||||||
|
ax = 0;
|
||||||
|
} else if (mode == 's') {
|
||||||
|
if (axismode & XTRANS)
|
||||||
|
ax = 1;
|
||||||
|
}
|
||||||
firsttime=1;
|
firsttime=1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -5108,6 +5115,13 @@ void transform(int mode)
|
|||||||
else{
|
else{
|
||||||
axismode= YTRANS;
|
axismode= YTRANS;
|
||||||
}
|
}
|
||||||
|
if (mode == 'g') {
|
||||||
|
if (axismode & YTRANS)
|
||||||
|
ax = 1;
|
||||||
|
} else if (mode == 's') {
|
||||||
|
if (axismode & YTRANS)
|
||||||
|
ax = 2;
|
||||||
|
}
|
||||||
firsttime=1;
|
firsttime=1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -5119,6 +5133,13 @@ void transform(int mode)
|
|||||||
else{
|
else{
|
||||||
axismode= ZTRANS;
|
axismode= ZTRANS;
|
||||||
}
|
}
|
||||||
|
if (mode == 'g') {
|
||||||
|
if (axismode & ZTRANS)
|
||||||
|
ax = 2;
|
||||||
|
} else if (mode == 's') {
|
||||||
|
if (axismode & ZTRANS)
|
||||||
|
ax = 3;
|
||||||
|
}
|
||||||
firsttime=1;
|
firsttime=1;
|
||||||
break;
|
break;
|
||||||
case WHEELDOWNMOUSE:
|
case WHEELDOWNMOUSE:
|
||||||
@ -5259,6 +5280,8 @@ void transform(int mode)
|
|||||||
if ((mode == 'S') || (mode == 'w') || (mode == 'C') || (mode == 'N'))
|
if ((mode == 'S') || (mode == 'w') || (mode == 'C') || (mode == 'N'))
|
||||||
break;
|
break;
|
||||||
if ((mode != 'r') && (mode != 'R')){
|
if ((mode != 'r') && (mode != 'R')){
|
||||||
|
if (axismode != 0)
|
||||||
|
break;
|
||||||
ax += 1;
|
ax += 1;
|
||||||
if (mode == 's'){
|
if (mode == 's'){
|
||||||
if (ax == 4){ax=0;}
|
if (ax == 4){ax=0;}
|
||||||
@ -5306,6 +5329,12 @@ void transform(int mode)
|
|||||||
typemode = 1;
|
typemode = 1;
|
||||||
del = 0;
|
del = 0;
|
||||||
if (mode == 's'){
|
if (mode == 's'){
|
||||||
|
if (axismode & XTRANS)
|
||||||
|
ax = 1;
|
||||||
|
if (axismode & YTRANS)
|
||||||
|
ax = 2;
|
||||||
|
if (axismode & ZTRANS)
|
||||||
|
ax = 3;
|
||||||
if (ax == 0){
|
if (ax == 0){
|
||||||
if (pe[0]){
|
if (pe[0]){
|
||||||
int div = 1;
|
int div = 1;
|
||||||
@ -5377,6 +5406,12 @@ void transform(int mode)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
if (axismode & XTRANS)
|
||||||
|
ax = 0;
|
||||||
|
if (axismode & YTRANS)
|
||||||
|
ax = 1;
|
||||||
|
if (axismode & ZTRANS)
|
||||||
|
ax = 2;
|
||||||
if (pe[ax]){
|
if (pe[ax]){
|
||||||
int div = 1;
|
int div = 1;
|
||||||
int i;
|
int i;
|
||||||
|
Loading…
Reference in New Issue
Block a user