diff options
author | Sebastian Parborg <darkdefende@gmail.com> | 2021-06-29 18:29:09 +0300 |
---|---|---|
committer | Sebastian Parborg <darkdefende@gmail.com> | 2021-06-30 12:20:42 +0300 |
commit | be451354c9251d816b0e2950e334ae44931f6166 (patch) | |
tree | 794fa9318c5984ec9c492f9dfdec5cefd0e031e4 /source | |
parent | 918d9291d611a10d4a9ceff13edc3ef2ac486207 (diff) |
Fix T89153: Follow Path for empty works only in negative values
The old code only clamped cyclic curves
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/constraint.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index 1d5cfa752a4..ca03c9c3de4 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -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); } } |