Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/transform/transform_mode_baketime.c
| Show All 30 Lines | |||||
| #include "ED_screen.h" | #include "ED_screen.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 (Bake-Time) */ | /* Transform (Bake-Time) */ | ||||
| /** \name Transform Bake-Time | /** \name Transform Bake-Time | ||||
| * \{ */ | * \{ */ | ||||
| static void applyBakeTime(TransInfo *t, const int mval[2]) | static void applyBakeTime(TransInfo *t, const int mval[2]) | ||||
| { | { | ||||
| float time; | float time; | ||||
| int i; | |||||
| char str[UI_MAX_DRAW_STR]; | char str[UI_MAX_DRAW_STR]; | ||||
| float fac = 0.1f; | float fac = 0.1f; | ||||
| /* XXX, disable precision for now, | /* XXX, disable precision for now, | ||||
| * this isn't even accessible by the user */ | * this isn't even accessible by the user */ | ||||
| #if 0 | #if 0 | ||||
| if (t->mouse.precision) { | if (t->mouse.precision) { | ||||
| Show All 31 Lines | else { | ||||
| } | } | ||||
| else { | else { | ||||
| BLI_snprintf(str, sizeof(str), TIP_("Time: %.3f %s"), time, t->proptext); | BLI_snprintf(str, sizeof(str), TIP_("Time: %.3f %s"), time, t->proptext); | ||||
| } | } | ||||
| } | } | ||||
| 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; | ||||
| } | } | ||||
| if (td->val) { | if (td->special[tdi].val) { | ||||
| *td->val = td->ival + time * td->factor; | *td->special[tdi].val = td->special[tdi].ival + time * td->prop[tdi].factor; | ||||
| if (td->ext->size && *td->val < *td->ext->size) { | if (td->ext[tdi].size && *td->special[tdi].val < *td->ext[tdi].size) { | ||||
| *td->val = *td->ext->size; | *(td->special[tdi].val) = *td->ext[tdi].size; | ||||
| } | } | ||||
| if (td->ext->quat && *td->val > *td->ext->quat) { | if (td->ext[tdi].quat && *td->special[tdi].val > *td->ext[tdi].quat) { | ||||
| *td->val = *td->ext->quat; | *td->special[tdi].val = *td->ext[tdi].quat; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| recalcData(t); | recalcData(t); | ||||
| ED_area_status_text(t->area, str); | ED_area_status_text(t->area, str); | ||||
| Show All 18 Lines | |||||