Page MenuHome

constraint.c.patch

Authored By
Peter Amstutz (tetron)
Nov 13 2013, 4:25 PM
Size
963 B
Subscribers
None

constraint.c.patch

Index: blender/source/blender/blenkernel/intern/constraint.c
===================================================================
--- blender/source/blender/blenkernel/intern/constraint.c (revision 42976)
+++ blender/source/blender/blenkernel/intern/constraint.c (working copy)
@@ -1264,7 +1264,21 @@
* factor, which then gets clamped to lie within 0.0 - 1.0 range
*/
curvetime /= cu->pathlen;
- CLAMP(curvetime, 0.0f, 1.0f);
+
+ if (cu->nurb.first) {
+ Nurb *nu = cu->nurb.first;
+ if (nu->flagu & CU_NURB_CYCLIC) {
+ /* If the curve is cyclic, enable looping around if the time is
+ outside the bounds 0..1 */
+ if ((curvetime < 0.0f) || (curvetime > 1.0f)) {
+ curvetime -= floor(curvetime);
+ }
+ }
+ else {
+ /* The curve is not cyclic, so clamp to the begin/end points. */
+ CLAMP(curvetime, 0.0f, 1.0f);
+ }
+ }
}
else {
/* fixed position along curve */

File Metadata

Mime Type
text/x-diff
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
ae/23/38b355d842188dccccb1f0938fce

Event Timeline