Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-07-10 07:51:25 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-07-10 07:51:25 +0300
commitf51c6efbc183aa10c143f1e4a2588e14163c2f9f (patch)
tree0e31d302b05482f30a472aadc1852936e3d10eeb /source/blender
parent8c528a4f0aaf62737f5a768e4190609925134ca0 (diff)
Fix transform plane constraint orientation cycle
Regression since 2.79b release
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/transform/transform.c41
1 files changed, 15 insertions, 26 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index ad7c0980bca..58c8837328a 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -895,7 +895,7 @@ wmKeyMap *transform_modal_keymap(wmKeyConfig *keyconf)
return keymap;
}
-static void transform_event_xyz_constraint(TransInfo *t, short key_type, char cmode)
+static void transform_event_xyz_constraint(TransInfo *t, short key_type, char cmode, bool is_plane)
{
if (!(t->flag & T_NO_CONSTRAINT)) {
int constraint_axis, constraint_plane;
@@ -948,17 +948,21 @@ static void transform_event_xyz_constraint(TransInfo *t, short key_type, char cm
else {
short orientation = (t->current_orientation != V3D_MANIP_GLOBAL ?
t->current_orientation : V3D_MANIP_LOCAL);
- if (!(t->modifiers & MOD_CONSTRAINT_PLANE))
+ if (is_plane == false) {
setUserConstraint(t, orientation, constraint_axis, msg2);
- else if (t->modifiers & MOD_CONSTRAINT_PLANE)
+ }
+ else {
setUserConstraint(t, orientation, constraint_plane, msg3);
+ }
}
}
else {
- if (!(t->modifiers & MOD_CONSTRAINT_PLANE))
+ if (is_plane == false) {
setUserConstraint(t, V3D_MANIP_GLOBAL, constraint_axis, msg2);
- else if (t->modifiers & MOD_CONSTRAINT_PLANE)
+ }
+ else {
setUserConstraint(t, V3D_MANIP_GLOBAL, constraint_plane, msg3);
+ }
}
}
t->redraw |= TREDRAW_HARD;
@@ -1136,57 +1140,42 @@ int transformEvent(TransInfo *t, const wmEvent *event)
break;
case TFM_MODAL_AXIS_X:
if (!(t->flag & T_NO_CONSTRAINT)) {
- transform_event_xyz_constraint(t, XKEY, cmode);
+ transform_event_xyz_constraint(t, XKEY, cmode, false);
t->redraw |= TREDRAW_HARD;
handled = true;
}
break;
case TFM_MODAL_AXIS_Y:
if ((t->flag & T_NO_CONSTRAINT) == 0) {
- transform_event_xyz_constraint(t, YKEY, cmode);
+ transform_event_xyz_constraint(t, YKEY, cmode, false);
t->redraw |= TREDRAW_HARD;
handled = true;
}
break;
case TFM_MODAL_AXIS_Z:
if ((t->flag & (T_NO_CONSTRAINT)) == 0) {
- transform_event_xyz_constraint(t, ZKEY, cmode);
+ transform_event_xyz_constraint(t, ZKEY, cmode, false);
t->redraw |= TREDRAW_HARD;
handled = true;
}
break;
case TFM_MODAL_PLANE_X:
if ((t->flag & (T_NO_CONSTRAINT | T_2D_EDIT)) == 0) {
- if (cmode == 'X') {
- stopConstraint(t);
- }
- else {
- setUserConstraint(t, t->current_orientation, (CON_AXIS1 | CON_AXIS2), IFACE_("locking %s X"));
- }
+ transform_event_xyz_constraint(t, XKEY, cmode, true);
t->redraw |= TREDRAW_HARD;
handled = true;
}
break;
case TFM_MODAL_PLANE_Y:
if ((t->flag & (T_NO_CONSTRAINT | T_2D_EDIT)) == 0) {
- if (cmode == 'Y') {
- stopConstraint(t);
- }
- else {
- setUserConstraint(t, t->current_orientation, (CON_AXIS0 | CON_AXIS2), IFACE_("locking %s Y"));
- }
+ transform_event_xyz_constraint(t, YKEY, cmode, true);
t->redraw |= TREDRAW_HARD;
handled = true;
}
break;
case TFM_MODAL_PLANE_Z:
if ((t->flag & (T_NO_CONSTRAINT | T_2D_EDIT)) == 0) {
- if (cmode == 'Z') {
- stopConstraint(t);
- }
- else {
- setUserConstraint(t, t->current_orientation, (CON_AXIS0 | CON_AXIS1), IFACE_("locking %s Z"));
- }
+ transform_event_xyz_constraint(t, ZKEY, cmode, true);
t->redraw |= TREDRAW_HARD;
handled = true;
}