diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-07-10 07:53:12 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-07-10 07:53:12 +0300 |
commit | 8a816fd3bc1eabbdd13c4d75edbfef58c1e91cdb (patch) | |
tree | b6ba2df235fab52ed8e5b583d4d7e75559d65ff9 /source/blender/editors/transform | |
parent | 1112f49a14ba3bdf2c960a61a1975458e3ee986f (diff) | |
parent | f51c6efbc183aa10c143f1e4a2588e14163c2f9f (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/editors/transform')
-rw-r--r-- | source/blender/editors/transform/transform.c | 41 |
1 files changed, 15 insertions, 26 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 1f2589d8a0c..d0934e0acb0 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -989,7 +989,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; @@ -1042,17 +1042,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; @@ -1232,57 +1236,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; } |