Fix T42354 modal transform map not cycling through local/global

orientation properly

Patch by Phillip Oeser, thanks!
This commit is contained in:
Antonis Ryakiotakis 2014-10-23 14:16:36 +02:00
parent 3b7794dab7
commit dbea73a30f
Notes: blender-bot 2023-02-14 09:54:17 +01:00
Referenced by issue #42354, make transform modal map 'Orientation XXX axis' constraints more consistent with default ('X'/'Y'/'Z') behaviour
1 changed files with 5 additions and 30 deletions

View File

@ -1125,47 +1125,22 @@ int transformEvent(TransInfo *t, const wmEvent *event)
handled = true;
break;
case TFM_MODAL_AXIS_X:
if ((t->flag & T_NO_CONSTRAINT) == 0) {
if (cmode == 'X') {
stopConstraint(t);
}
else {
if (t->flag & T_2D_EDIT) {
setUserConstraint(t, V3D_MANIP_GLOBAL, (CON_AXIS0), IFACE_("along X"));
}
else {
setUserConstraint(t, t->current_orientation, (CON_AXIS0), IFACE_("along %s X"));
}
}
if (!(t->flag & T_NO_CONSTRAINT)) {
transform_event_xyz_constraint(t, XKEY, cmode);
t->redraw |= TREDRAW_HARD;
handled = true;
}
break;
case TFM_MODAL_AXIS_Y:
if ((t->flag & T_NO_CONSTRAINT) == 0) {
if (cmode == 'Y') {
stopConstraint(t);
}
else {
if (t->flag & T_2D_EDIT) {
setUserConstraint(t, V3D_MANIP_GLOBAL, (CON_AXIS1), IFACE_("along Y"));
}
else {
setUserConstraint(t, t->current_orientation, (CON_AXIS1), IFACE_("along %s Y"));
}
}
transform_event_xyz_constraint(t, YKEY, cmode);
t->redraw |= TREDRAW_HARD;
handled = true;
}
break;
case TFM_MODAL_AXIS_Z:
if ((t->flag & (T_NO_CONSTRAINT | T_2D_EDIT)) == 0) {
if (cmode == 'Z') {
stopConstraint(t);
}
else {
setUserConstraint(t, t->current_orientation, (CON_AXIS2), IFACE_("along %s Z"));
}
if ((t->flag & (T_NO_CONSTRAINT)) == 0) {
transform_event_xyz_constraint(t, ZKEY, cmode);
t->redraw |= TREDRAW_HARD;
handled = true;
}