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/transform/transform.c | |
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/transform/transform.c')
-rw-r--r-- | source/blender/editors/transform/transform.c | 39 |
1 files changed, 8 insertions, 31 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]); |