Page MenuHome

Enable looping with Follow Path constraint and cyclic curves
Closed, ArchivedPublicPATCH

Description

In Blender 2.61, the Follow Path constraint clamps animation to the begin and end points of the curve. When using time offsets to put multiple objects at different points along the same path animation (for example a conveyor belt or tank treads) this produces undesirable results as objects cannot proceed prior to the begin point or past the end point the path as would be naturally expected for cyclic curves.

The attached patch enables the follow path constraint to loop around curves when the evalutation time is below 0 or above the curve length (in frames) for cyclic curves. Non-cyclic curves retain the current behavior. The attached blend file demonstrates the benefit of this change for animating periodic motion along a path.

Event Timeline

its a bit too simple, please add an option for thr number of repeats and an infinate option so the user has much more control over the cyclic looping, once this is done, i will commit

Are these additional options really necessary? In Blender 2.6, the position of an object along the path is set via keyframes, so the user already has complete control over the number times an object loops around the path.

If the path time is 100 frames, the current behavior is that a keyframe (set on the curve object) for time value of -25 or 125 is clamped to the range 0 to 100 by the Follow Path constraint. With this patch, if the path is cyclic, a keyframe of -25 puts the object at the same position as 75 and a keyframe of 125 is the same position as 25. If you want the object to go around the path once, you put a final keyframe of 100, if you want it to go around twice you put a final keyframe of 200, three times, a final keyframe of 300, and so forth. If you want it to reverse direction, you can put a final keyframe of -100, etc. You can't have it loop infinitely, but that's due to the way the curves and the Path Follow constraint are designed and changing it seems out of the scope of this patch.


Campbell Barton (campbellbarton) changed the task status from Unknown Status to Unknown Status.Dec 30 2011, 3:53 PM