diff options
author | Germano Cavalcante <germano.costa@ig.com.br> | 2022-08-08 18:32:58 +0300 |
---|---|---|
committer | Germano Cavalcante <germano.costa@ig.com.br> | 2022-08-08 18:37:25 +0300 |
commit | b3fc8206be422a7d0155f0282c2493887e441dd3 (patch) | |
tree | eb451dbdd7aadd736cdc86ca6e740ec54144017f | |
parent | 2e6fcd9aadd54bc02f0efdc42e56159fa18f3450 (diff) |
Revert "Fix T100280: GG not toggling the offset transform mode in tracker"
This reverts commits b72eddac6190353714745756dcc335f98cda1369 and
f8b5706a1ffe61ae3bdd949ad851d6e9ff3fe188.
And fixes T100265.
It brings more problems than solutions.
7 files changed, 23 insertions, 113 deletions
diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py b/release/scripts/presets/keyconfig/keymap_data/blender_default.py index 10c8c58763b..d08efc6909b 100644 --- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py +++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py @@ -5751,9 +5751,7 @@ def km_transform_modal_map(_params): ("PLANE_Z", {"type": 'Z', "value": 'PRESS', "shift": True}, None), ("CONS_OFF", {"type": 'C', "value": 'PRESS'}, None), ("TRANSLATE", {"type": 'G', "value": 'PRESS'}, None), - ("VERT_EDGE_SLIDE", {"type": 'G', "value": 'PRESS'}, None), ("ROTATE", {"type": 'R', "value": 'PRESS'}, None), - ("TRACKBALL", {"type": 'R', "value": 'PRESS'}, None), ("RESIZE", {"type": 'S', "value": 'PRESS'}, None), ("SNAP_TOGGLE", {"type": 'TAB', "value": 'PRESS', "shift": True}, None), ("SNAP_INV_ON", {"type": 'LEFT_CTRL', "value": 'PRESS', "any": True}, None), 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 c1e44ffe306..c9d66afb796 100644 --- a/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py +++ b/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py @@ -3968,9 +3968,7 @@ def km_transform_modal_map(_params): ("PLANE_Z", {"type": 'Z', "value": 'PRESS', "shift": True}, None), ("CONS_OFF", {"type": 'C', "value": 'PRESS'}, None), ("TRANSLATE", {"type": 'G', "value": 'PRESS'}, None), - ("VERT_EDGE_SLIDE", {"type": 'G', "value": 'PRESS'}, None), ("ROTATE", {"type": 'R', "value": 'PRESS'}, None), - ("TRACKBALL", {"type": 'R', "value": 'PRESS'}, None), ("RESIZE", {"type": 'S', "value": 'PRESS'}, None), ("SNAP_TOGGLE", {"type": 'TAB', "value": 'PRESS', "shift": True}, None), ("SNAP_INV_ON", {"type": 'LEFT_CTRL', "value": 'PRESS', "any": True}, None), diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index bb1776e2756..8dcbf07b776 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -641,48 +641,10 @@ static bool transform_modal_item_poll(const wmOperator *op, int value) } case TFM_MODAL_TRANSLATE: case TFM_MODAL_ROTATE: - case TFM_MODAL_RESIZE: - case TFM_MODAL_VERT_EDGE_SLIDE: - case TFM_MODAL_TRACKBALL: { + case TFM_MODAL_RESIZE: { if (!transform_mode_is_changeable(t->mode)) { return false; } - if (value == TFM_MODAL_TRANSLATE && t->mode == TFM_TRANSLATION) { - return false; - } - if (value == TFM_MODAL_ROTATE && t->mode == TFM_ROTATION) { - return false; - } - if (value == TFM_MODAL_RESIZE && t->mode == TFM_RESIZE) { - return false; - } - if (value == TFM_MODAL_VERT_EDGE_SLIDE && - (t->data_type != &TransConvertType_Mesh || - /* WORKAROUND: Avoid repeated keys in status bar. - * - * Previously, `Vert/Edge Slide` and `Move` were triggered by the same modal key. - * But now, to fix T100129, `Vert/Edge Slide` has its own modal key. - * However by default it uses the same key as `Move` (G). - * So, to avoid displaying the same key twice (G and G), only display this modal key - * during the `Move` operation. - * - * Ideally we should check if it really uses the same key. */ - t->mode != TFM_TRANSLATION)) { - return false; - } - if (value == TFM_MODAL_TRACKBALL && - /* WORKAROUND: Avoid repeated keys in status bar. - * - * Previously, `Trackball` and `Rotate` were triggered by the same modal key. - * But now, to fix T100129, `Trackball` has its own modal key. - * However by default it uses the same key as `Rotate` (R). - * So, to avoid displaying the same key twice (R and R), only display this modal key - * during the `Rotate` operation. - * - * Ideally we should check if it really uses the same key. */ - t->mode != TFM_ROTATION) { - return false; - } break; } } @@ -729,9 +691,7 @@ wmKeyMap *transform_modal_keymap(wmKeyConfig *keyconf) "Toggle Direction for Node Auto-Offset", ""}, {TFM_MODAL_TRANSLATE, "TRANSLATE", 0, "Move", ""}, - {TFM_MODAL_VERT_EDGE_SLIDE, "VERT_EDGE_SLIDE", 0, "Vert/Edge Slide", ""}, {TFM_MODAL_ROTATE, "ROTATE", 0, "Rotate", ""}, - {TFM_MODAL_TRACKBALL, "TRACKBALL", 0, "TrackBall", ""}, {TFM_MODAL_RESIZE, "RESIZE", 0, "Resize", ""}, {TFM_MODAL_AUTOCONSTRAINT, "AUTOCONSTRAIN", 0, "Automatic Constraint", ""}, {TFM_MODAL_AUTOCONSTRAINTPLANE, "AUTOCONSTRAINPLANE", 0, "Automatic Constraint Plane", ""}, @@ -974,15 +934,8 @@ int transformEvent(TransInfo *t, const wmEvent *event) handled = true; break; case TFM_MODAL_TRANSLATE: - case TFM_MODAL_VERT_EDGE_SLIDE: /* only switch when... */ - if (!transform_mode_is_changeable(t->mode)) { - break; - } - if (event->val == TFM_MODAL_VERT_EDGE_SLIDE) { - if (ELEM(t->mode, TFM_VERT_SLIDE, TFM_EDGE_SLIDE)) { - break; - } + if (t->mode == TFM_TRANSLATION) { if ((t->obedit_type == OB_MESH) && (t->spacetype == SPACE_VIEW3D)) { restoreTransObjects(t); resetTransModal(t); @@ -1008,11 +961,15 @@ int transformEvent(TransInfo *t, const wmEvent *event) t->redraw |= TREDRAW_HARD; handled = true; } - } - else { - if (t->mode == TFM_TRANSLATION) { - break; + else if (t->options & (CTX_MOVIECLIP | CTX_MASK)) { + restoreTransObjects(t); + + t->flag ^= T_ALT_TRANSFORM; + t->redraw |= TREDRAW_HARD; + handled = true; } + } + else if (transform_mode_is_changeable(t->mode)) { restoreTransObjects(t); resetTransModal(t); resetTransRestrictions(t); @@ -1023,33 +980,23 @@ int transformEvent(TransInfo *t, const wmEvent *event) } break; case TFM_MODAL_ROTATE: - case TFM_MODAL_TRACKBALL: /* only switch when... */ - if (!transform_mode_is_changeable(t->mode)) { - break; - } - if (event->val == TFM_MODAL_TRACKBALL) { - if (t->mode == TFM_TRACKBALL) { - break; - } - } - else if (t->mode == TFM_ROTATION) { - break; - } if (!(t->options & CTX_TEXTURE_SPACE) && !(t->options & (CTX_MOVIECLIP | CTX_MASK))) { - restoreTransObjects(t); - resetTransModal(t); - resetTransRestrictions(t); + if (transform_mode_is_changeable(t->mode)) { + restoreTransObjects(t); + resetTransModal(t); + resetTransRestrictions(t); - if (event->val == TFM_MODAL_TRACKBALL) { - transform_mode_init(t, NULL, TFM_TRACKBALL); - } - else { - transform_mode_init(t, NULL, TFM_ROTATION); + if (t->mode == TFM_ROTATION) { + transform_mode_init(t, NULL, TFM_TRACKBALL); + } + else { + transform_mode_init(t, NULL, TFM_ROTATION); + } + initSnapping(t, NULL); /* need to reinit after mode change */ + t->redraw |= TREDRAW_HARD; + handled = true; } - initSnapping(t, NULL); /* need to reinit after mode change */ - t->redraw |= TREDRAW_HARD; - handled = true; } break; case TFM_MODAL_RESIZE: diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h index fee6acfbfa7..fc59787e1ec 100644 --- a/source/blender/editors/transform/transform.h +++ b/source/blender/editors/transform/transform.h @@ -253,9 +253,6 @@ enum { TFM_MODAL_AUTOCONSTRAINTPLANE = 29, TFM_MODAL_PRECISION = 30, - - TFM_MODAL_VERT_EDGE_SLIDE = 31, - TFM_MODAL_TRACKBALL = 32, }; /** \} */ diff --git a/source/blender/editors/transform/transform_mode_resize.c b/source/blender/editors/transform/transform_mode_resize.c index 309b8759320..1ccda96fecb 100644 --- a/source/blender/editors/transform/transform_mode_resize.c +++ b/source/blender/editors/transform/transform_mode_resize.c @@ -287,7 +287,6 @@ void initResize(TransInfo *t, float mouse_dir_constraint[3]) { t->mode = TFM_RESIZE; t->transform = applyResize; - t->handleEvent = NULL; t->tsnap.applySnap = ApplySnapResize; t->tsnap.distance = ResizeBetween; diff --git a/source/blender/editors/transform/transform_mode_rotate.c b/source/blender/editors/transform/transform_mode_rotate.c index ece9fe8855f..a7207b36578 100644 --- a/source/blender/editors/transform/transform_mode_rotate.c +++ b/source/blender/editors/transform/transform_mode_rotate.c @@ -351,7 +351,6 @@ void initRotation(TransInfo *t) t->mode = TFM_ROTATION; t->transform = applyRotation; - t->handleEvent = NULL; t->transform_matrix = applyRotationMatrix; t->tsnap.applySnap = ApplySnapRotation; t->tsnap.distance = RotationBetween; diff --git a/source/blender/editors/transform/transform_mode_translate.c b/source/blender/editors/transform/transform_mode_translate.c index c4f3d5575cd..04a41814b53 100644 --- a/source/blender/editors/transform/transform_mode_translate.c +++ b/source/blender/editors/transform/transform_mode_translate.c @@ -56,8 +56,6 @@ struct TranslateCustomData { struct { enum eTranslateRotateMode rotate_mode; } prev; - - const wmKeyMapItem *move_kmi; }; /** \} */ @@ -172,27 +170,6 @@ static void transdata_elem_translate_fn(void *__restrict iter_data_v, /** \} */ /* -------------------------------------------------------------------- */ -/** \name Events to Move Clip and Mask - * \{ */ - -static eRedrawFlag translate_handleEvent(struct TransInfo *t, const wmEvent *event) -{ - BLI_assert(t->options & (CTX_MOVIECLIP | CTX_MASK)); - struct TranslateCustomData *custom_data = t->custom.mode.data; - const wmKeyMapItem *kmi = custom_data->move_kmi; - if (kmi && event->type == kmi->type && event->val == kmi->val) { - /* Toggles the handle offset effect. */ - restoreTransObjects(t); - - t->flag ^= T_ALT_TRANSFORM; - return TREDRAW_HARD; - } - return TREDRAW_NOTHING; -} - -/** \} */ - -/* -------------------------------------------------------------------- */ /** \name Transform (Translation) * \{ */ @@ -643,11 +620,6 @@ void initTranslation(TransInfo *t) custom_data->prev.rotate_mode = TRANSLATE_ROTATE_OFF; t->custom.mode.data = custom_data; t->custom.mode.use_free = true; - - if (t->keymap && (t->options & (CTX_MOVIECLIP | CTX_MASK))) { - custom_data->move_kmi = WM_modalkeymap_find_propvalue(t->keymap, TFM_MODAL_TRANSLATE); - t->handleEvent = translate_handleEvent; - } } /** \} */ |