Fix T89153: Follow Path for empty works only in negative values

The old code only clamped cyclic curves
This commit is contained in:
Sebastian Parborg 2021-06-29 17:29:09 +02:00 committed by Jeroen Bakker
parent aa1bbadb5b
commit 2659bc5457
Notes: blender-bot 2023-02-14 09:29:42 +01:00
Referenced by issue #88449, Blender LTS: Maintenance Task 2.93
Referenced by issue #89153, Follow Path for empty works only in negative values
1 changed files with 4 additions and 1 deletions

View File

@ -1476,7 +1476,10 @@ static void followpath_get_tarmat(struct Depsgraph *UNUSED(depsgraph),
* to get a time factor. */
curvetime /= cu->pathlen;
if (cu->flag & CU_PATH_CLAMP) {
Nurb *nu = cu->nurb.first;
if (!(nu && nu->flagu & CU_NURB_CYCLIC) && cu->flag & CU_PATH_CLAMP) {
/* If curve is not cyclic, clamp to the begin/end points if the curve clamp option is on.
*/
CLAMP(curvetime, 0.0f, 1.0f);
}
}