Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/transform/transform_mode_timetranslate.c
| Show First 20 Lines • Show All 56 Lines • ▼ Show 20 Lines | static void headerTimeTranslate(TransInfo *t, char str[UI_MAX_DRAW_STR]) | ||||
| if (hasNumInput(&t->num)) { | if (hasNumInput(&t->num)) { | ||||
| outputNumInput(&(t->num), tvec, &t->scene->unit); | outputNumInput(&(t->num), tvec, &t->scene->unit); | ||||
| } | } | ||||
| else { | else { | ||||
| const short autosnap = getAnimEdit_SnapMode(t); | const short autosnap = getAnimEdit_SnapMode(t); | ||||
| float ival = TRANS_DATA_CONTAINER_FIRST_OK(t)->data->ival; | float ival = TRANS_DATA_CONTAINER_FIRST_OK(t)->data->ival; | ||||
| float val = ival + t->values_final[0]; | float val = ival + t->values_final[0]; | ||||
| float snap_val = val; | snapFrameTransform(t, autosnap, ival, val, &val); | ||||
| snapFrameTransform(t, autosnap, ival, val, &snap_val); | float delta_x = val - ival; | ||||
| if (ELEM(autosnap, SACTSNAP_SECOND, SACTSNAP_TSTEP)) { | if (ELEM(autosnap, SACTSNAP_SECOND, SACTSNAP_TSTEP)) { | ||||
| /* Convert to seconds. */ | /* Convert to seconds. */ | ||||
| const Scene *scene = t->scene; | const Scene *scene = t->scene; | ||||
| const double secf = FPS; | const double secf = FPS; | ||||
| snap_val /= secf; | delta_x /= secf; | ||||
| val /= secf; | |||||
| } | } | ||||
| if (autosnap == SACTSNAP_FRAME) { | if (autosnap == SACTSNAP_FRAME) { | ||||
| BLI_snprintf(&tvec[0], NUM_STR_REP_LEN, "%.2f (%.4f)", snap_val, val); | BLI_snprintf(&tvec[0], NUM_STR_REP_LEN, "%.2f (%.4f)", delta_x, val); | ||||
| } | } | ||||
| else if (autosnap == SACTSNAP_SECOND) { | else if (autosnap == SACTSNAP_SECOND) { | ||||
| BLI_snprintf(&tvec[0], NUM_STR_REP_LEN, "%.2f sec (%.4f)", snap_val, val); | BLI_snprintf(&tvec[0], NUM_STR_REP_LEN, "%.2f sec (%.4f)", delta_x, val); | ||||
| } | } | ||||
| else if (autosnap == SACTSNAP_TSTEP) { | else if (autosnap == SACTSNAP_TSTEP) { | ||||
| BLI_snprintf(&tvec[0], NUM_STR_REP_LEN, "%.4f sec", snap_val); | BLI_snprintf(&tvec[0], NUM_STR_REP_LEN, "%.4f sec", delta_x); | ||||
| } | } | ||||
| else { | else { | ||||
| BLI_snprintf(&tvec[0], NUM_STR_REP_LEN, "%.4f", snap_val); | BLI_snprintf(&tvec[0], NUM_STR_REP_LEN, "%.4f", delta_x); | ||||
| } | } | ||||
| } | } | ||||
| ofs += BLI_snprintf_rlen(str, UI_MAX_DRAW_STR, TIP_("DeltaX: %s"), &tvec[0]); | ofs += BLI_snprintf_rlen(str, UI_MAX_DRAW_STR, TIP_("DeltaX: %s"), &tvec[0]); | ||||
| if (t->flag & T_PROP_EDIT_ALL) { | if (t->flag & T_PROP_EDIT_ALL) { | ||||
| ofs += BLI_snprintf_rlen( | ofs += BLI_snprintf_rlen( | ||||
| str + ofs, UI_MAX_DRAW_STR - ofs, TIP_(" Proportional size: %.2f"), t->prop_size); | str + ofs, UI_MAX_DRAW_STR - ofs, TIP_(" Proportional size: %.2f"), t->prop_size); | ||||
| ▲ Show 20 Lines • Show All 68 Lines • Show Last 20 Lines | |||||