Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/constraint.c
| Show First 20 Lines • Show All 992 Lines • ▼ Show 20 Lines | |||||
| if ((data->followflag & FOLLOWPATH_STATIC) == 0) { | if ((data->followflag & FOLLOWPATH_STATIC) == 0) { | ||||
| /* animated position along curve depending on time */ | /* animated position along curve depending on time */ | ||||
| curvetime = cu->ctime - data->offset; | curvetime = cu->ctime - data->offset; | ||||
| /* ctime is now a proper var setting of Curve which gets set by Animato like any other var | /* ctime is now a proper var setting of Curve which gets set by Animato like any other var | ||||
| * that's animated, but this will only work if it actually is animated... | * 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, | * 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; | curvetime /= cu->pathlen; | ||||
| if (cu->flag & CU_PATH_CLAMP) { | |||||
| CLAMP(curvetime, 0.0f, 1.0f); | |||||
| } | |||||
| } | } | ||||
| else { | else { | ||||
| /* fixed position along curve */ | /* fixed position along curve */ | ||||
| curvetime = data->offset_fac; | curvetime = data->offset_fac; | ||||
| } | } | ||||
| if (BKE_where_on_path(ct->tar, | if (BKE_where_on_path(ct->tar, | ||||
| curvetime, | curvetime, | ||||
| ▲ Show 20 Lines • Show All 992 Lines • Show Last 20 Lines | |||||