Fix T66941: GPencil wrong interpolation calculation for last keyframe

The range used for frames was wrong and the last keyframe was way off of the correct place.

Thanks to @MagnumOctopus for catching the bug.
This commit is contained in:
Antonioya
2019-07-15 16:56:32 +02:00
parent 8a5a8282ce
commit 69aa5bba4f

View File

@@ -996,8 +996,9 @@ static int gpencil_interpolate_seq_exec(bContext *C, wmOperator *op)
float factor;
/* get interpolation factor */
factor = (float)(cframe - prevFrame->framenum) /
(nextFrame->framenum - prevFrame->framenum + 1);
float framerange = nextFrame->framenum - prevFrame->framenum;
CLAMP_MIN(framerange, 1.0f);
factor = (float)(cframe - prevFrame->framenum) / framerange;
if (ipo_settings->type == GP_IPO_CURVEMAP) {
/* custom curvemap */