From cf2baa585cc8788b29147d6e34fa8c46609e5bf9 Mon Sep 17 00:00:00 2001 From: Sebastian Parborg Date: Thu, 8 Apr 2021 15:51:08 +0200 Subject: Fix T81707: Spline IK Joints "Floating" above curve The issue was that where_on_path uses a resampled curve to get the data from the curve. This leads to disconnects between the curve the user sees and the evaluated location data. To fix this we simply use the actual curve data the user can see. The older code needed a cleanup either way as there were hacks in other parts of the code trying to work around some brokenness. This is now fixed and we no longer need to clamp the evaluation range to 0-1 or make helper functions to make it do what we actually want. Reviewed By: Campbell, Sybren Differential Revision: http://developer.blender.org/D10898 --- source/blender/blenkernel/BKE_curve.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'source/blender/blenkernel/BKE_curve.h') diff --git a/source/blender/blenkernel/BKE_curve.h b/source/blender/blenkernel/BKE_curve.h index 8381f015bee..26c9bef7d6c 100644 --- a/source/blender/blenkernel/BKE_curve.h +++ b/source/blender/blenkernel/BKE_curve.h @@ -50,7 +50,14 @@ typedef struct CurveCache { ListBase disp; ListBase bev; ListBase deformed_nurbs; - struct Path *path; + /* This array contains the accumulative length of the curve segments. + * So you can see this as a "total distance traveled" along the curve. + * The first entry is the length between point 0 and 1 while the last is the + * total length of the curve. + * + * Used by 'BKE_where_on_path'. + */ + float *anim_path_accum_length; } CurveCache; /* Definitions needed for shape keys */ -- cgit v1.2.3