From 6a0906c09a263f5fb17449407f5988c4bda53436 Mon Sep 17 00:00:00 2001 From: Sebastian Parborg Date: Thu, 20 May 2021 20:41:10 +0200 Subject: Fix T87854: Add clamp option to Path Animation Previously, the "follow path constraint" and "follow parented curve" were clamped. This restriction was lifted in rBcf2baa585cc8 Add back an option to get the old behavior in the "Path animation" settings. Reviewed By: Sybren Differential Revision: http://developer.blender.org/D11263 --- source/blender/blenkernel/intern/constraint.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source/blender/blenkernel/intern/constraint.c') diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index 2ee030ca83f..bcd2c75be0d 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -1473,8 +1473,12 @@ static void followpath_get_tarmat(struct Depsgraph *UNUSED(depsgraph), * that's animated, but this will only work if it actually is animated... * * we divide the curvetime calculated in the previous step by the length of the path, - * to get a time factor, which then gets clamped to lie within 0.0 - 1.0 range. */ + * to get a time factor. */ curvetime /= cu->pathlen; + + if (cu->flag & CU_PATH_CLAMP) { + CLAMP(curvetime, 0.0f, 1.0f); + } } else { /* fixed position along curve */ -- cgit v1.2.3