Conversation
lyuma
left a comment
There was a problem hiding this comment.
Looks good. I was able to reproduce the issue and it would be solved by a continue (as in the ended > 0 case we moved first.
Adding some of this information as comments might be helpful to others reading this code.
Tokage says:Processing only when fitting to a spline causes sudden changes, so I am interpolating the tilt based on the distance from the path using fade-in/fade-out.
Regarding the end, for example, if the spline length is 1.5 and there are two bones with a length of 1, the tip of the second bone will not be on the spline. This code is intended to provide a deterministic way to handle the orientation and interpolation in such cases. This behavior is consistent with Blender.
Tokage says:When
endedis 0, the joint is on the path; whenendedis 1, the joint is in an interpolation state; whenendedis 2, no action is taken on subsequent joints.
|
Thanks! |
An out-of-bounds access occurred when there was only one point and it was closer than the first segment. I added the case where there is only one point as an OR condition to the abort case in the calculation for the first segment. Fixes SplineIK crash if Path3D Curve only have 1 point #117724.
Because the first segment had a higher priority than the
endedflag, there were cases where the first segment was incorrectly searched afterended, which caused an infinite loop (see MRP). I swapped the priority of the flags. Fixes SplineIK3D SplineIK3DSetting::find_nearest_point infinite loop on overlapping Curve3D #114564.