[#19354] Second press of axis key didn't do local orientation when global was selected as user orientation (frankly, I don't like it much to have an exception for that, but backward compatibility is ok, unless someone else has a strong argument against).
This commit is contained in:
@@ -773,10 +773,11 @@ void transformEvent(TransInfo *t, wmEvent *event)
|
||||
stopConstraint(t);
|
||||
}
|
||||
else {
|
||||
short orientation = t->current_orientation != V3D_MANIP_GLOBAL ? t->current_orientation : V3D_MANIP_LOCAL;
|
||||
if ((t->modifiers & MOD_CONSTRAINT_PLANE) == 0)
|
||||
setUserConstraint(t, (CON_AXIS0), "along %s X");
|
||||
setUserConstraint(t, orientation, (CON_AXIS0), "along %s X");
|
||||
else if (t->modifiers & MOD_CONSTRAINT_PLANE)
|
||||
setUserConstraint(t, (CON_AXIS1|CON_AXIS2), "locking %s X");
|
||||
setUserConstraint(t, orientation, (CON_AXIS1|CON_AXIS2), "locking %s X");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -805,10 +806,11 @@ void transformEvent(TransInfo *t, wmEvent *event)
|
||||
stopConstraint(t);
|
||||
}
|
||||
else {
|
||||
short orientation = t->current_orientation != V3D_MANIP_GLOBAL ? t->current_orientation : V3D_MANIP_LOCAL;
|
||||
if ((t->modifiers & MOD_CONSTRAINT_PLANE) == 0)
|
||||
setUserConstraint(t, (CON_AXIS1), "along %s Y");
|
||||
setUserConstraint(t, orientation, (CON_AXIS1), "along %s Y");
|
||||
else if (t->modifiers & MOD_CONSTRAINT_PLANE)
|
||||
setUserConstraint(t, (CON_AXIS0|CON_AXIS2), "locking %s Y");
|
||||
setUserConstraint(t, orientation, (CON_AXIS0|CON_AXIS2), "locking %s Y");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -833,10 +835,11 @@ void transformEvent(TransInfo *t, wmEvent *event)
|
||||
stopConstraint(t);
|
||||
}
|
||||
else {
|
||||
short orientation = t->current_orientation != V3D_MANIP_GLOBAL ? t->current_orientation : V3D_MANIP_LOCAL;
|
||||
if ((t->modifiers & MOD_CONSTRAINT_PLANE) == 0)
|
||||
setUserConstraint(t, (CON_AXIS2), "along %s Z");
|
||||
setUserConstraint(t, orientation, (CON_AXIS2), "along %s Z");
|
||||
else if ((t->modifiers & MOD_CONSTRAINT_PLANE) && ((t->flag & T_2D_EDIT)==0))
|
||||
setUserConstraint(t, (CON_AXIS0|CON_AXIS1), "locking %s Z");
|
||||
setUserConstraint(t, orientation, (CON_AXIS0|CON_AXIS1), "locking %s Z");
|
||||
}
|
||||
}
|
||||
else if ((t->flag & T_2D_EDIT)==0) {
|
||||
@@ -1511,7 +1514,7 @@ int initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, int
|
||||
t->con.mode |= CON_AXIS2;
|
||||
}
|
||||
|
||||
setUserConstraint(t, t->con.mode, "%s");
|
||||
setUserConstraint(t, t->current_orientation, t->con.mode, "%s");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -548,7 +548,7 @@ void drawConstraint(const struct bContext *C, TransInfo *t);
|
||||
void getConstraintMatrix(TransInfo *t);
|
||||
void setConstraint(TransInfo *t, float space[3][3], int mode, const char text[]);
|
||||
void setLocalConstraint(TransInfo *t, int mode, const char text[]);
|
||||
void setUserConstraint(TransInfo *t, int mode, const char text[]);
|
||||
void setUserConstraint(TransInfo *t, short orientation, int mode, const char text[]);
|
||||
|
||||
void constraintNumInput(TransInfo *t, float vec[3]);
|
||||
|
||||
|
||||
@@ -551,11 +551,10 @@ void setLocalConstraint(TransInfo *t, int mode, const char text[]) {
|
||||
ftext is a format string passed to sprintf. It will add the name of
|
||||
the orientation where %s is (logically).
|
||||
*/
|
||||
void setUserConstraint(TransInfo *t, int mode, const char ftext[]) {
|
||||
void setUserConstraint(TransInfo *t, short orientation, int mode, const char ftext[]) {
|
||||
char text[40];
|
||||
//short twmode= (t->spacetype==SPACE_VIEW3D)? ((View3D*)t->view)->twmode: V3D_MANIP_GLOBAL;
|
||||
|
||||
switch(t->current_orientation) {
|
||||
switch(orientation) {
|
||||
case V3D_MANIP_GLOBAL:
|
||||
{
|
||||
float mtx[3][3];
|
||||
|
||||
Reference in New Issue
Block a user