diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-09-04 08:30:14 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-09-04 08:33:07 +0300 |
commit | 0cb730146b09b4a38abcc04e9d4660d6c2f43945 (patch) | |
tree | 1ebab357adaf2d89e7eea19bf17630f2f07bc085 /source/blender/editors | |
parent | 966c00060f8e2239e9149b0300a34a57080e0c0b (diff) |
Transform: remove X/Y shear tool option
Instead use vertical cursor motion for Y axis shear.
This removes the shear_axis option completely since we now have two
axis options used by shear it's not needed.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/transform/transform.c | 39 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_gizmo_3d.c | 1 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_ops.c | 1 |
3 files changed, 8 insertions, 33 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index c344b6c8649..ade09d88c5d 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -2302,12 +2302,6 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op) RNA_property_boolean_set( op->ptr, prop, (t->settings->uvcalc_flag & UVCALC_TRANSFORM_CORRECT) != 0); } - - if (t->mode == TFM_SHEAR) { - prop = RNA_struct_find_property(op->ptr, "shear_axis"); - t->custom.mode.data = POINTER_FROM_INT(RNA_property_enum_get(op->ptr, prop)); - RNA_property_enum_set(op->ptr, prop, POINTER_AS_INT(t->custom.mode.data)); - } } /** @@ -2517,8 +2511,6 @@ bool initTransform(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve initToSphere(t); break; case TFM_SHEAR: - prop = RNA_struct_find_property(op->ptr, "shear_axis"); - t->custom.mode.data = POINTER_FROM_INT(RNA_property_enum_get(op->ptr, prop)); initShear(t); break; case TFM_BEND: @@ -3515,13 +3507,7 @@ static void Bend(TransInfo *t, const int UNUSED(mval[2])) static void initShear_mouseInputMode(TransInfo *t) { float dir[3]; - - if (t->custom.mode.data == NULL) { - copy_v3_v3(dir, t->orient_matrix[t->orient_axis_ortho]); - } - else { - cross_v3_v3v3(dir, t->orient_matrix[t->orient_axis], t->orient_matrix[t->orient_axis_ortho]); - } + copy_v3_v3(dir, t->orient_matrix[t->orient_axis_ortho]); /* Without this, half the gizmo handles move in the opposite direction. */ if ((t->orient_axis_ortho + 1) % 3 != t->orient_axis) { @@ -3569,24 +3555,22 @@ static eRedrawFlag handleEventShear(TransInfo *t, const wmEvent *event) if (event->type == MIDDLEMOUSE && event->val == KM_PRESS) { /* Use custom.mode.data pointer to signal Shear direction */ - if (t->custom.mode.data == NULL) { - t->custom.mode.data = (void *)1; - } - else { - t->custom.mode.data = NULL; - } + do { + t->orient_axis_ortho = (t->orient_axis_ortho + 1) % 3; + } while (t->orient_axis_ortho == t->orient_axis); + initShear_mouseInputMode(t); status = TREDRAW_HARD; } else if (event->type == XKEY && event->val == KM_PRESS) { - t->custom.mode.data = NULL; + t->orient_axis_ortho = (t->orient_axis + 1) % 3; initShear_mouseInputMode(t); status = TREDRAW_HARD; } else if (event->type == YKEY && event->val == KM_PRESS) { - t->custom.mode.data = (void *)1; + t->orient_axis_ortho = (t->orient_axis + 2) % 3; initShear_mouseInputMode(t); status = TREDRAW_HARD; @@ -3630,14 +3614,7 @@ static void applyShear(TransInfo *t, const int UNUSED(mval[2])) } unit_m3(smat); - - // Custom data signals shear direction - if (t->custom.mode.data == NULL) { - smat[1][0] = value; - } - else { - smat[0][1] = value; - } + smat[1][0] = value; copy_v3_v3(axismat_inv[0], t->orient_matrix[t->orient_axis_ortho]); copy_v3_v3(axismat_inv[2], t->orient_matrix[t->orient_axis]); diff --git a/source/blender/editors/transform/transform_gizmo_3d.c b/source/blender/editors/transform/transform_gizmo_3d.c index 355cf139abf..b52bb46bb51 100644 --- a/source/blender/editors/transform/transform_gizmo_3d.c +++ b/source/blender/editors/transform/transform_gizmo_3d.c @@ -2295,7 +2295,6 @@ static void WIDGETGROUP_xform_shear_setup(const bContext *UNUSED(C), wmGizmoGrou interp_v3_v3v3(gz->color, axis_color[i_ortho_a], axis_color[i_ortho_b], 0.75f); gz->color[3] = 0.5f; PointerRNA *ptr = WM_gizmo_operator_set(gz, 0, ot_shear, NULL); - RNA_enum_set(ptr, "shear_axis", 0); RNA_boolean_set(ptr, "release_confirm", 1); xgzgroup->gizmo[i][j] = gz; } diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c index 604c5bbc083..fd166b676b9 100644 --- a/source/blender/editors/transform/transform_ops.c +++ b/source/blender/editors/transform/transform_ops.c @@ -910,7 +910,6 @@ static void TRANSFORM_OT_shear(struct wmOperatorType *ot) ot->poll_property = transform_poll_property; RNA_def_float(ot->srna, "value", 0, -FLT_MAX, FLT_MAX, "Offset", "", -FLT_MAX, FLT_MAX); - RNA_def_enum(ot->srna, "shear_axis", rna_enum_axis_xy_items, 0, "Shear Axis", ""); WM_operatortype_props_advanced_begin(ot); |