Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/transform/transform_mode_resize.c
| Show First 20 Lines • Show All 69 Lines • ▼ Show 20 Lines | static void ApplySnapResize(TransInfo *t, float vec[3]) | ||||
| getSnapPoint(t, point); | getSnapPoint(t, point); | ||||
| float dist = ResizeBetween(t, t->tsnap.snapTarget, point); | float dist = ResizeBetween(t, t->tsnap.snapTarget, point); | ||||
| if (dist != TRANSFORM_DIST_INVALID) { | if (dist != TRANSFORM_DIST_INVALID) { | ||||
| copy_v3_fl(vec, dist); | copy_v3_fl(vec, dist); | ||||
| } | } | ||||
| } | } | ||||
| static void resize_update_baseboint_fn(TransInfo *t, | |||||
| const float new_base_point[3], | |||||
| float r_base_point_final[3]) | |||||
| { | |||||
| float mat[3][3]; | |||||
| size_to_mat3(mat, t->values_final); | |||||
| invert_m3(mat); | |||||
| mul_v3_m3v3(r_base_point_final, t->spacemtx_inv, new_base_point); | |||||
| mul_m3_v3(mat, r_base_point_final); | |||||
| mul_m3_v3(t->spacemtx, r_base_point_final); | |||||
| } | |||||
| static void applyResize(TransInfo *t, const int UNUSED(mval[2])) | static void applyResize(TransInfo *t, const int UNUSED(mval[2])) | ||||
| { | { | ||||
| float mat[3][3]; | float mat[3][3]; | ||||
| int i; | int i; | ||||
| char str[UI_MAX_DRAW_STR]; | char str[UI_MAX_DRAW_STR]; | ||||
| if (t->flag & T_INPUT_IS_VALUES_FINAL) { | if (t->flag & T_INPUT_IS_VALUES_FINAL) { | ||||
| copy_v3_v3(t->values_final, t->values); | copy_v3_v3(t->values_final, t->values); | ||||
| ▲ Show 20 Lines • Show All 75 Lines • ▼ Show 20 Lines | static void applyResize(TransInfo *t, const int UNUSED(mval[2])) | ||||
| ED_area_status_text(t->area, str); | ED_area_status_text(t->area, str); | ||||
| } | } | ||||
| void initResize(TransInfo *t) | void initResize(TransInfo *t) | ||||
| { | { | ||||
| t->mode = TFM_RESIZE; | t->mode = TFM_RESIZE; | ||||
| t->transform = applyResize; | t->transform = applyResize; | ||||
| t->tsnap.applySnap = ApplySnapResize; | t->tsnap.applySnap = ApplySnapResize; | ||||
| t->tsnap.updateBasePoint = resize_update_baseboint_fn; | |||||
| t->tsnap.distance = ResizeBetween; | t->tsnap.distance = ResizeBetween; | ||||
| initMouseInputMode(t, &t->mouse, INPUT_SPRING_FLIP); | initMouseInputMode(t, &t->mouse, INPUT_SPRING_FLIP); | ||||
| t->flag |= T_NULL_ONE; | t->flag |= T_NULL_ONE; | ||||
| t->num.val_flag[0] |= NUM_NULL_ONE; | t->num.val_flag[0] |= NUM_NULL_ONE; | ||||
| t->num.val_flag[1] |= NUM_NULL_ONE; | t->num.val_flag[1] |= NUM_NULL_ONE; | ||||
| t->num.val_flag[2] |= NUM_NULL_ONE; | t->num.val_flag[2] |= NUM_NULL_ONE; | ||||
| Show All 22 Lines | |||||