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:
@@ -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];
|
||||
}
|
||||
|
Reference in New Issue
Block a user