Fix constrain plane masking shift event

This prevented transformation with a precision modifier.
This commit is contained in:
Germano Cavalcante 2020-09-01 10:38:28 -03:00
parent 26d5c24f0a
commit 8170c92ed4
4 changed files with 3 additions and 19 deletions

View File

@ -4994,8 +4994,6 @@ def km_transform_modal_map(_params):
("AUTOIK_CHAIN_LEN_DOWN", {"type": 'WHEELUPMOUSE', "value": 'PRESS', "shift": True}, None),
("INSERTOFS_TOGGLE_DIR", {"type": 'T', "value": 'PRESS', "repeat": False}, None),
("AUTOCONSTRAIN", {"type": 'MIDDLEMOUSE', "value": 'PRESS', "repeat": False}, None),
("CONSTRAINPLANE", {"type": 'LEFT_SHIFT', "value": 'PRESS', "repeat": False}, None),
("CONSTRAINPLANE", {"type": 'RIGHT_SHIFT', "value": 'PRESS', "repeat": False}, None),
])
return keymap

View File

@ -3936,8 +3936,6 @@ def km_transform_modal_map(_params):
("AUTOIK_CHAIN_LEN_DOWN", {"type": 'WHEELUPMOUSE', "value": 'PRESS', "shift": True}, None),
("INSERTOFS_TOGGLE_DIR", {"type": 'T', "value": 'PRESS'}, None),
("AUTOCONSTRAIN", {"type": 'MIDDLEMOUSE', "value": 'PRESS'}, None),
("CONSTRAINPLANE", {"type": 'LEFT_SHIFT', "value": 'PRESS', "repeat": False}, None),
("CONSTRAINPLANE", {"type": 'RIGHT_SHIFT', "value": 'PRESS', "repeat": False}, None),
])
return keymap

View File

@ -688,11 +688,6 @@ wmKeyMap *transform_modal_keymap(wmKeyConfig *keyconf)
0,
"Automatically detects one direction for constraint",
""},
{TFM_MODAL_CONSTRAINTPLANE,
"CONSTRAINPLANE",
0,
"modifier that enables the plane type constraint",
""},
{0, NULL, 0, NULL, NULL},
};
@ -713,10 +708,6 @@ wmKeyMap *transform_modal_keymap(wmKeyConfig *keyconf)
* WM_modalkeymap_add_item(keymap, EVT_RKEY, KM_PRESS, KM_ANY, 0, TFM_MODAL_ROTATE);
* WM_modalkeymap_add_item(keymap, EVT_SKEY, KM_PRESS, KM_ANY, 0, TFM_MODAL_RESIZE);
* WM_modalkeymap_add_item(keymap, MIDDLEMOUSE, KM_PRESS, KM_ANY, 0, TFM_MODAL_AUTOCONSTRAINT);
* WM_modalkeymap_add_item(
* keymap, EVT_LEFTSHIFTKEY, KM_PRESS, KM_ANY, 0, TFM_MODAL_CONSTRAINTPLANE);
* WM_modalkeymap_add_item(
* keymap, EVT_RIGHTSHIFTKEY, KM_PRESS, KM_ANY, 0, TFM_MODAL_CONSTRAINTPLANE);
* \endcode
*/
@ -981,6 +972,7 @@ int transformEvent(TransInfo *t, const wmEvent *event)
break;
case TFM_MODAL_PLANE_X:
if ((t->flag & (T_NO_CONSTRAINT | T_2D_EDIT)) == 0) {
t->modifiers |= MOD_CONSTRAINT_PLANE;
transform_event_xyz_constraint(t, EVT_XKEY, true);
t->redraw |= TREDRAW_HARD;
handled = true;
@ -988,6 +980,7 @@ int transformEvent(TransInfo *t, const wmEvent *event)
break;
case TFM_MODAL_PLANE_Y:
if ((t->flag & (T_NO_CONSTRAINT | T_2D_EDIT)) == 0) {
t->modifiers |= MOD_CONSTRAINT_PLANE;
transform_event_xyz_constraint(t, EVT_YKEY, true);
t->redraw |= TREDRAW_HARD;
handled = true;
@ -995,6 +988,7 @@ int transformEvent(TransInfo *t, const wmEvent *event)
break;
case TFM_MODAL_PLANE_Z:
if ((t->flag & (T_NO_CONSTRAINT | T_2D_EDIT)) == 0) {
t->modifiers |= MOD_CONSTRAINT_PLANE;
transform_event_xyz_constraint(t, EVT_ZKEY, true);
t->redraw |= TREDRAW_HARD;
handled = true;
@ -1116,11 +1110,6 @@ int transformEvent(TransInfo *t, const wmEvent *event)
handled = true;
}
break;
case TFM_MODAL_CONSTRAINTPLANE:
t->modifiers |= MOD_CONSTRAINT_PLANE;
t->redraw |= TREDRAW_HARD;
handled = true;
break;
/* Those two are only handled in transform's own handler, see T44634! */
case TFM_MODAL_EDGESLIDE_UP:
case TFM_MODAL_EDGESLIDE_DOWN:

View File

@ -577,7 +577,6 @@ enum {
TFM_MODAL_INSERTOFS_TOGGLE_DIR = 27,
TFM_MODAL_AUTOCONSTRAINT = 28,
TFM_MODAL_CONSTRAINTPLANE = 29,
};
bool initTransform(struct bContext *C,