Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/transform/transform_mode_shear.c
| Show First 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | |||||
| /** \name Transform Shear | /** \name Transform Shear | ||||
| * \{ */ | * \{ */ | ||||
| static void initShear_mouseInputMode(TransInfo *t) | static void initShear_mouseInputMode(TransInfo *t) | ||||
| { | { | ||||
| float dir[3]; | float dir[3]; | ||||
| bool dir_flip = false; | bool dir_flip = false; | ||||
| copy_v3_v3(dir, t->orient_matrix[t->orient_axis_ortho]); | copy_v3_v3(dir, t->spacemtx[t->orient_axis_ortho]); | ||||
| /* Needed for axis aligned view gizmo. */ | /* Needed for axis aligned view gizmo. */ | ||||
| if (t->orientation.user == V3D_ORIENT_VIEW) { | if (t->orientation.types[t->orientation.index] == V3D_ORIENT_VIEW) { | ||||
| if (t->orient_axis_ortho == 0) { | if (t->orient_axis_ortho == 0) { | ||||
| if (t->center2d[1] > t->mouse.imval[1]) { | if (t->center2d[1] > t->mouse.imval[1]) { | ||||
| dir_flip = !dir_flip; | dir_flip = !dir_flip; | ||||
| } | } | ||||
| } | } | ||||
| else if (t->orient_axis_ortho == 1) { | else if (t->orient_axis_ortho == 1) { | ||||
| if (t->center2d[0] > t->mouse.imval[0]) { | if (t->center2d[0] > t->mouse.imval[0]) { | ||||
| dir_flip = !dir_flip; | dir_flip = !dir_flip; | ||||
| ▲ Show 20 Lines • Show All 81 Lines • ▼ Show 20 Lines | BLI_snprintf(str, | ||||
| TIP_("Shear: %.3f %s (Press X or Y to set shear axis)"), | TIP_("Shear: %.3f %s (Press X or Y to set shear axis)"), | ||||
| value, | value, | ||||
| t->proptext); | t->proptext); | ||||
| } | } | ||||
| unit_m3(smat); | unit_m3(smat); | ||||
| smat[1][0] = value; | smat[1][0] = value; | ||||
| copy_v3_v3(axismat_inv[0], t->orient_matrix[t->orient_axis_ortho]); | copy_v3_v3(axismat_inv[0], t->spacemtx[t->orient_axis_ortho]); | ||||
| copy_v3_v3(axismat_inv[2], t->orient_matrix[t->orient_axis]); | copy_v3_v3(axismat_inv[2], t->spacemtx[t->orient_axis]); | ||||
| cross_v3_v3v3(axismat_inv[1], axismat_inv[0], axismat_inv[2]); | cross_v3_v3v3(axismat_inv[1], axismat_inv[0], axismat_inv[2]); | ||||
| invert_m3_m3(axismat, axismat_inv); | invert_m3_m3(axismat, axismat_inv); | ||||
| mul_m3_series(totmat, axismat_inv, smat, axismat); | mul_m3_series(totmat, axismat_inv, smat, axismat); | ||||
| FOREACH_TRANS_DATA_CONTAINER (t, tc) { | FOREACH_TRANS_DATA_CONTAINER (t, tc) { | ||||
| TransData *td = tc->data; | TransData *td = tc->data; | ||||
| for (i = 0; i < tc->data_len; i++, td++) { | for (i = 0; i < tc->data_len; i++, td++) { | ||||
| ▲ Show 20 Lines • Show All 82 Lines • Show Last 20 Lines | |||||