diff options
author | Germano Cavalcante <germano.costa@ig.com.br> | 2021-11-18 20:19:59 +0300 |
---|---|---|
committer | Germano Cavalcante <germano.costa@ig.com.br> | 2021-11-18 20:19:59 +0300 |
commit | f190f2d267df46d25d74009a3c14ac10753d57ca (patch) | |
tree | 1027d79363821162f50ef4948552119f7491c738 /source/blender/editors/transform/transform.c | |
parent | 0c33411bddfd3e2ab85dbf8411334f18fdaeb460 (diff) |
Revert fixes
Diffstat (limited to 'source/blender/editors/transform/transform.c')
-rw-r--r-- | source/blender/editors/transform/transform.c | 64 |
1 files changed, 11 insertions, 53 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 51167b327d6..ae4c3f02c46 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -108,6 +108,9 @@ void setTransformViewMatrices(TransInfo *t) unit_m4(t->persinv); t->persp = RV3D_ORTHO; } + + calculateCenter2D(t); + calculateCenterLocal(t, t->center_global); } void setTransformViewAspect(TransInfo *t, float r_aspect[3]) @@ -575,21 +578,6 @@ static void viewRedrawPost(bContext *C, TransInfo *t) static bool transform_modal_item_poll(const wmOperator *op, int value) { const TransInfo *t = op->customdata; - if (t->modifiers & MOD_EDIT_SNAP_SOURCE) { - if (value == TFM_MODAL_EDIT_SNAP_SOURCE) { - return true; - } - else if (!ELEM(value, - TFM_MODAL_CANCEL, - TFM_MODAL_CONFIRM, - TFM_MODAL_SNAP_INV_ON, - TFM_MODAL_SNAP_INV_OFF, - TFM_MODAL_ADD_SNAP, - TFM_MODAL_REMOVE_SNAP)) { - return false; - } - } - switch (value) { case TFM_MODAL_CANCEL: { /* TODO: Canceling with LMB is not possible when the operator is activated @@ -605,13 +593,6 @@ static bool transform_modal_item_poll(const wmOperator *op, int value) } break; } - case TFM_MODAL_SNAP_INV_ON: - case TFM_MODAL_SNAP_INV_OFF: { - if (t->modifiers & MOD_SNAP_TEMP) { - return false; - } - break; - } case TFM_MODAL_ADD_SNAP: case TFM_MODAL_REMOVE_SNAP: { if (t->spacetype != SPACE_VIEW3D) { @@ -683,19 +664,6 @@ static bool transform_modal_item_poll(const wmOperator *op, int value) } break; } - case TFM_MODAL_EDIT_SNAP_SOURCE: { - if (t->spacetype != SPACE_VIEW3D) { - return false; - } - if (t->flag & T_RELEASE_CONFIRM) { - return false; - } - if (!ELEM(t->mode, TFM_TRANSLATION, TFM_ROTATION, TFM_RESIZE)) { - /* More modes can be added over time if this feature proves useful for them. */ - return false; - } - break; - } } return true; } @@ -746,7 +714,6 @@ wmKeyMap *transform_modal_keymap(wmKeyConfig *keyconf) {TFM_MODAL_AUTOCONSTRAINT, "AUTOCONSTRAIN", 0, "Automatic Constraint", ""}, {TFM_MODAL_AUTOCONSTRAINTPLANE, "AUTOCONSTRAINPLANE", 0, "Automatic Constraint Plane", ""}, {TFM_MODAL_PRECISION, "PRECISION", 0, "Precision Mode", ""}, - {TFM_MODAL_EDIT_SNAP_SOURCE, "EDIT_SNAP_SOURCE", 0, "Snap Source Toggle", ""}, {0, NULL, 0, NULL, NULL}, }; @@ -899,6 +866,8 @@ int transformEvent(TransInfo *t, const wmEvent *event) t->con.mode |= CON_SELECT; } + copy_v2_v2_int(t->mval, event->mval); + /* Use this for soft redraw. Might cause flicker in object mode */ // t->redraw |= TREDRAW_SOFT; t->redraw |= TREDRAW_HARD; @@ -922,12 +891,7 @@ int transformEvent(TransInfo *t, const wmEvent *event) handled = true; break; case TFM_MODAL_CONFIRM: - if (t->modifiers & MOD_EDIT_SNAP_SOURCE) { - tranform_snap_source_mod_confirm(t); - } - else { - t->state = TRANS_CONFIRM; - } + t->state = TRANS_CONFIRM; handled = true; break; case TFM_MODAL_TRANSLATE: @@ -1192,9 +1156,6 @@ int transformEvent(TransInfo *t, const wmEvent *event) t->redraw |= TREDRAW_HARD; } break; - case TFM_MODAL_EDIT_SNAP_SOURCE: - tranform_snap_source_mod_toggle(t); - break; /* Those two are only handled in transform's own handler, see T44634! */ case TFM_MODAL_EDGESLIDE_UP: case TFM_MODAL_EDGESLIDE_DOWN: @@ -1571,7 +1532,7 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op) if (t->flag & T_MODAL) { /* do we check for parameter? */ - if (transformModeUseSnap(t) && !(t->modifiers & MOD_SNAP_TEMP)) { + if (transformModeUseSnap(t)) { if (!(t->modifiers & MOD_SNAP) != !(ts->snap_flag & SCE_SNAP)) { if (t->modifiers & MOD_SNAP) { ts->snap_flag |= SCE_SNAP; @@ -1959,17 +1920,14 @@ void transformApply(bContext *C, TransInfo *t) if ((t->redraw & TREDRAW_HARD) || (t->draw_handle_apply == NULL && (t->redraw & TREDRAW_SOFT))) { selectConstraint(t); - if (t->modifiers & MOD_EDIT_SNAP_SOURCE) { - tranform_snap_source_mod_update(t); - } - else if (t->transform) { + if (t->transform) { t->transform(t, t->mval); /* calls recalcData() */ + viewRedrawForce(C, t); } + t->redraw = TREDRAW_NOTHING; } - - if (t->redraw & (TREDRAW_HARD | TREDRAW_SOFT)) { + else if (t->redraw & TREDRAW_SOFT) { viewRedrawForce(C, t); - t->redraw = TREDRAW_NOTHING; } /* If auto confirm is on, break after one pass */ |