Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/transform/transform_mode_shrink_fatten.c
| Show All 32 Lines | |||||
| #include "WM_api.h" | #include "WM_api.h" | ||||
| #include "UI_interface.h" | #include "UI_interface.h" | ||||
| #include "BLT_translation.h" | #include "BLT_translation.h" | ||||
| #include "transform.h" | #include "transform.h" | ||||
| #include "transform_data.h" | |||||
| #include "transform_mode.h" | #include "transform_mode.h" | ||||
| #include "transform_snap.h" | #include "transform_snap.h" | ||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| /* Transform (Shrink-Fatten) */ | /* Transform (Shrink-Fatten) */ | ||||
| /** \name Transform Shrink-Fatten | /** \name Transform Shrink-Fatten | ||||
| * \{ */ | * \{ */ | ||||
| static void applyShrinkFatten(TransInfo *t, const int UNUSED(mval[2])) | static void applyShrinkFatten(TransInfo *t, const int UNUSED(mval[2])) | ||||
| { | { | ||||
| float distance; | float distance; | ||||
| int i; | |||||
| char str[UI_MAX_DRAW_STR]; | char str[UI_MAX_DRAW_STR]; | ||||
| size_t ofs = 0; | size_t ofs = 0; | ||||
| distance = -t->values[0]; | distance = -t->values[0]; | ||||
| snapGridIncrement(t, &distance); | snapGridIncrement(t, &distance); | ||||
| applyNumInput(&t->num, &distance); | applyNumInput(&t->num, &distance); | ||||
| Show All 26 Lines | static void applyShrinkFatten(TransInfo *t, const int UNUSED(mval[2])) | ||||
| BLI_snprintf(str + ofs, | BLI_snprintf(str + ofs, | ||||
| sizeof(str) - ofs, | sizeof(str) - ofs, | ||||
| TIP_(" or Alt) Even Thickness %s"), | TIP_(" or Alt) Even Thickness %s"), | ||||
| WM_bool_as_string((t->flag & T_ALT_TRANSFORM) != 0)); | WM_bool_as_string((t->flag & T_ALT_TRANSFORM) != 0)); | ||||
| /* done with header string */ | /* done with header string */ | ||||
| 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++) { | ||||
| float tdistance; /* temp dist */ | float tdistance; /* temp dist */ | ||||
| if (td->flag & TD_SKIP) { | if (td->basic[tdi].flag & TD_SKIP) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| /* get the final offset */ | /* get the final offset */ | ||||
| tdistance = distance * td->factor; | tdistance = distance * td->prop[tdi].factor; | ||||
| if (td->ext && (t->flag & T_ALT_TRANSFORM) != 0) { | if (td->ext && (t->flag & T_ALT_TRANSFORM) != 0) { | ||||
| tdistance *= td->ext->isize[0]; /* shell factor */ | tdistance *= td->ext[tdi].isize[0]; /* shell factor */ | ||||
| } | } | ||||
| madd_v3_v3v3fl(td->loc, td->iloc, td->axismtx[2], tdistance); | madd_v3_v3v3fl( | ||||
| td->basic[tdi].loc, td->basic[tdi].iloc, td->space[tdi].axismtx[2], tdistance); | |||||
| } | } | ||||
| } | } | ||||
| recalcData(t); | recalcData(t); | ||||
| ED_area_status_text(t->area, str); | ED_area_status_text(t->area, str); | ||||
| } | } | ||||
| Show All 26 Lines | |||||