[Bf-blender-cvs] [8170c92ed41] master: Fix constrain plane masking shift event

Germano Cavalcante noreply at git.blender.org
Tue Sep 1 15:38:44 CEST 2020


Commit: 8170c92ed41f749ae3c5e8434fb3e55d7577c6df
Author: Germano Cavalcante
Date:   Tue Sep 1 10:38:28 2020 -0300
Branches: master
https://developer.blender.org/rB8170c92ed41f749ae3c5e8434fb3e55d7577c6df

Fix constrain plane masking shift event

This prevented transformation with a precision modifier.

===================================================================

M	release/scripts/presets/keyconfig/keymap_data/blender_default.py
M	release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
M	source/blender/editors/transform/transform.c
M	source/blender/editors/transform/transform.h

===================================================================

diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
index 051f52daa5a..3132c8d1aa8 100644
--- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py
+++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
@@ -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
diff --git a/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py b/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
index 36742b4df7a..ef85b45d41a 100644
--- a/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
+++ b/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
@@ -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
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index 421a8e2d43e..68d8c46d1dd 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -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:
diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h
index 9618e0d1bb9..1eaebeff64f 100644
--- a/source/blender/editors/transform/transform.h
+++ b/source/blender/editors/transform/transform.h
@@ -577,7 +577,6 @@ enum {
   TFM_MODAL_INSERTOFS_TOGGLE_DIR = 27,
 
   TFM_MODAL_AUTOCONSTRAINT = 28,
-  TFM_MODAL_CONSTRAINTPLANE = 29,
 };
 
 bool initTransform(struct bContext *C,



More information about the Bf-blender-cvs mailing list