Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/transform/transform_mode_resize.c
| Show All 29 Lines | |||||
| #include "ED_screen.h" | #include "ED_screen.h" | ||||
| #include "UI_interface.h" | #include "UI_interface.h" | ||||
| #include "transform.h" | #include "transform.h" | ||||
| #include "transform_constraints.h" | #include "transform_constraints.h" | ||||
| #include "transform_convert.h" | #include "transform_convert.h" | ||||
| #include "transform_data.h" | |||||
| #include "transform_mode.h" | #include "transform_mode.h" | ||||
| #include "transform_snap.h" | #include "transform_snap.h" | ||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| /* Transform (Resize) */ | /* Transform (Resize) */ | ||||
| /** \name Transform Resize | /** \name Transform Resize | ||||
| * \{ */ | * \{ */ | ||||
| Show All 18 Lines | if (applyNumInput(&t->num, t->values_final)) { | ||||
| constraintNumInput(t, t->values_final); | constraintNumInput(t, t->values_final); | ||||
| } | } | ||||
| applySnapping(t, t->values_final); | applySnapping(t, t->values_final); | ||||
| } | } | ||||
| size_to_mat3(mat, t->values_final); | size_to_mat3(mat, t->values_final); | ||||
| if (t->con.mode & CON_APPLY) { | if (t->con.mode & CON_APPLY) { | ||||
| t->con.applySize(t, NULL, NULL, mat); | t->con.applySize(t, NULL, 0, mat); | ||||
| /* Only so we have re-usable value with redo. */ | /* Only so we have re-usable value with redo. */ | ||||
| float pvec[3] = {0.0f, 0.0f, 0.0f}; | float pvec[3] = {0.0f, 0.0f, 0.0f}; | ||||
| int j = 0; | int j = 0; | ||||
| for (i = 0; i < 3; i++) { | for (i = 0; i < 3; i++) { | ||||
| if (!(t->con.mode & (CON_AXIS0 << i))) { | if (!(t->con.mode & (CON_AXIS0 << i))) { | ||||
| t->values_final[i] = 1.0f; | t->values_final[i] = 1.0f; | ||||
| } | } | ||||
| else { | else { | ||||
| pvec[j++] = t->values_final[i]; | pvec[j++] = t->values_final[i]; | ||||
| } | } | ||||
| } | } | ||||
| headerResize(t, pvec, str); | headerResize(t, pvec, str); | ||||
| } | } | ||||
| else { | else { | ||||
| headerResize(t, t->values_final, str); | headerResize(t, t->values_final, str); | ||||
| } | } | ||||
| copy_m3_m3(t->mat, mat); // used in gizmo | copy_m3_m3(t->mat, mat); // used in gizmo | ||||
| 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 (int tdi = 0; tdi < tc->data_len; tdi++) { | ||||
| if (td->flag & TD_SKIP) { | if (td->basic[tdi].flag & TD_SKIP) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| ElementResize(t, tc, td, mat); | ElementResize(t, tc, tdi, mat); | ||||
| } | } | ||||
| } | } | ||||
| /* evil hack - redo resize if cliping needed */ | /* evil hack - redo resize if cliping needed */ | ||||
| if (t->flag & T_CLIP_UV && clipUVTransform(t, t->values_final, 1)) { | if (t->flag & T_CLIP_UV && clipUVTransform(t, t->values_final, 1)) { | ||||
| size_to_mat3(mat, t->values_final); | size_to_mat3(mat, t->values_final); | ||||
| if (t->con.mode & CON_APPLY) { | if (t->con.mode & CON_APPLY) { | ||||
| t->con.applySize(t, NULL, NULL, mat); | t->con.applySize(t, NULL, 0, mat); | ||||
| } | } | ||||
| FOREACH_TRANS_DATA_CONTAINER (t, tc) { | FOREACH_TRANS_DATA_CONTAINER (t, tc) { | ||||
| TransData *td = tc->data; | for (int tdi = 0; tdi < tc->data_len; tdi++) { | ||||
| for (i = 0; i < tc->data_len; i++, td++) { | ElementResize(t, tc, tdi, mat); | ||||
| ElementResize(t, tc, td, mat); | |||||
| } | } | ||||
| /* In proportional edit it can happen that */ | /* In proportional edit it can happen that */ | ||||
| /* vertices in the radius of the brush end */ | /* vertices in the radius of the brush end */ | ||||
| /* outside the clipping area */ | /* outside the clipping area */ | ||||
| /* XXX HACK - dg */ | /* XXX HACK - dg */ | ||||
| if (t->flag & T_PROP_EDIT_ALL) { | if (t->flag & T_PROP_EDIT_ALL) { | ||||
| clipUVData(t); | clipUVData(t); | ||||
| ▲ Show 20 Lines • Show All 43 Lines • Show Last 20 Lines | |||||