diff options
author | mano-wii <germano.costa@ig.com.br> | 2019-08-06 20:02:19 +0300 |
---|---|---|
committer | mano-wii <germano.costa@ig.com.br> | 2019-08-06 20:02:29 +0300 |
commit | 3227b37141f485f08ac01f26566d84455cf459fe (patch) | |
tree | b025f7daa404a6998f27cad8e3956efff4668a59 /source/blender/editors/transform | |
parent | 317033a1be2ab5d0fa6df861aea416fef1fdb86b (diff) |
Fix Dopesheet transform regressions due to rB81dc76c19cff
Functions that begin with the name `apply` closely resemble the main callback to apply.
Ref T68137
Diffstat (limited to 'source/blender/editors/transform')
-rw-r--r-- | source/blender/editors/transform/transform.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index fe8320d1345..98203a7e316 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -9649,20 +9649,17 @@ static void headerTimeSlide(TransInfo *t, const float sval, char str[UI_MAX_DRAW BLI_snprintf(str, UI_MAX_DRAW_STR, TIP_("TimeSlide: %s"), &tvec[0]); } -static void applyTimeSlideValue(TransInfo *t, float sval) +static void applyTimeSlideValue(TransInfo *t, float sval, float cval) { int i; const float *range = t->custom.mode.data; float minx = range[0]; float maxx = range[1]; - t->values_final[0] = t->values[0]; /* set value for drawing black line */ if (t->spacetype == SPACE_ACTION) { SpaceAction *saction = (SpaceAction *)t->sa->spacedata.first; - float cvalf = t->values_final[0]; - - saction->timeslide = cvalf; + saction->timeslide = cval; } /* It doesn't matter whether we apply to t->data or @@ -9675,7 +9672,6 @@ static void applyTimeSlideValue(TransInfo *t, float sval) * (this is only valid when not in NLA) */ AnimData *adt = (t->spacetype != SPACE_NLA) ? td->extra : NULL; - float cval = t->values_final[0]; /* only apply to data if in range */ if ((sval > minx) && (sval < maxx)) { @@ -9736,7 +9732,7 @@ static void applyTimeSlide(TransInfo *t, const int mval[2]) t->values_final[0] = (maxx - minx) * t->vec[0] / 2.0f + sval[0]; headerTimeSlide(t, sval[0], str); - applyTimeSlideValue(t, sval[0]); + applyTimeSlideValue(t, sval[0], t->values_final[0]); recalcData(t); @@ -9808,14 +9804,13 @@ static void headerTimeScale(TransInfo *t, char str[UI_MAX_DRAW_STR]) BLI_snprintf(str, UI_MAX_DRAW_STR, TIP_("ScaleX: %s"), &tvec[0]); } -static void applyTimeScaleValue(TransInfo *t) +static void applyTimeScaleValue(TransInfo *t, float value) { Scene *scene = t->scene; int i; const short autosnap = getAnimEdit_SnapMode(t); const double secf = FPS; - t->values_final[0] = t->values[0]; FOREACH_TRANS_DATA_CONTAINER (t, tc) { TransData *td = tc->data; @@ -9827,7 +9822,7 @@ static void applyTimeScaleValue(TransInfo *t) */ AnimData *adt = (t->spacetype != SPACE_NLA) ? td->extra : NULL; float startx = CFRA; - float fac = t->values_final[0]; + float fac = value; if (autosnap == SACTSNAP_TSTEP) { fac = (float)(floor((double)fac / secf + 0.5) * secf); @@ -9863,7 +9858,7 @@ static void applyTimeScale(TransInfo *t, const int UNUSED(mval[2])) t->values_final[0] = t->vec[0]; headerTimeScale(t, str); - applyTimeScaleValue(t); + applyTimeScaleValue(t, t->values_final[0]); recalcData(t); |