Fix T46701: Sampled FCurve looks jagged when FModifiers (doing nothing) are present
This was caused by interpolation between samples being performed incorrectly (i.e. wrong order of arguments) when sampling more than once per frame.
This commit is contained in:
parent
4d33c37c9e
commit
9ac08840ae
Notes:
blender-bot
2023-02-14 08:27:37 +01:00
Referenced by issue #46701, Graph editor displays "fuzziness" when envelope fcurve modifier applied.
|
@ -2436,11 +2436,11 @@ static float fcurve_eval_samples(FCurve *fcu, FPoint *fpts, float evaltime)
|
|||
float t = fabsf(evaltime - floorf(evaltime));
|
||||
|
||||
/* find the one on the right frame (assume that these are spaced on 1-frame intervals) */
|
||||
fpt = prevfpt + (int)(evaltime - prevfpt->vec[0]);
|
||||
fpt = prevfpt + ((int)evaltime - (int)prevfpt->vec[0]);
|
||||
|
||||
/* if not exactly on the frame, perform linear interpolation with the next one */
|
||||
if (t != 0.0f)
|
||||
cvalue = interpf(fpt->vec[1], (fpt + 1)->vec[1], t);
|
||||
if ((t != 0.0f) && (t < 1.0f))
|
||||
cvalue = interpf(fpt->vec[1], (fpt + 1)->vec[1], 1.0f - t);
|
||||
else
|
||||
cvalue = fpt->vec[1];
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue