Fix T42367: Spline-ik offset evaluating curve
This commit is contained in:
parent
557d4370d9
commit
f651a470bf
Notes:
blender-bot
2023-02-14 09:54:11 +01:00
Referenced by issue #42367, Spline IK leaves a gap at the start of the bone chain
|
@ -627,6 +627,9 @@ int where_on_path(Object *ob, float ctime, float vec[4], float dir[3], float qua
|
|||
if (!bl->nr) return 0;
|
||||
if (bl->poly > -1) cycl = 1;
|
||||
|
||||
/* values below zero for non-cyclic curves give strange results */
|
||||
BLI_assert(cycl || ctime >= 0.0f);
|
||||
|
||||
ctime *= (path->len - 1);
|
||||
|
||||
s1 = (int)floor(ctime);
|
||||
|
|
|
@ -1940,6 +1940,9 @@ static void splineik_init_tree_from_pchan(Scene *scene, Object *UNUSED(ob), bPos
|
|||
}
|
||||
}
|
||||
|
||||
/* disallow negative values (happens with float precision) */
|
||||
CLAMP_MIN(ikData->points[segcount], 0.0f);
|
||||
|
||||
/* spline has now been bound */
|
||||
ikData->flag |= CONSTRAINT_SPLINEIK_BOUND;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue