#include "BKE_depsgraph.h"
#include "BKE_displist.h"
#include "BKE_global.h"
+#include "BKE_fcurve.h"
#include "BKE_lattice.h"
#include "BKE_library.h"
#include "BKE_main.h"
#include "ED_armature.h"
#include "ED_curve.h"
+#include "ED_keyframing.h"
#include "ED_object.h"
#include "ED_screen.h"
#include "ED_view3d.h"
}
else cu->flag |= CU_FOLLOW;
+ /* if follow, add F-Curve for ctime (i.e. "eval_time") so that path-follow works */
+ if(partype == PAR_FOLLOW) {
+ /* get or create F-Curve */
+ bAction *act = verify_adt_action(&cu->id, 1);
+ FCurve *fcu = verify_fcurve(act, NULL, "eval_time", 0, 1);
+
+ /* setup dummy 'generator' modifier here to get 1-1 correspondance still working */
+ if (!fcu->bezt && !fcu->fpt && !fcu->modifiers.first)
+ add_fmodifier(&fcu->modifiers, FMODIFIER_TYPE_GENERATOR);
+ }
+
/* fall back on regular parenting now (for follow only) */
if(partype == PAR_FOLLOW)
partype= PAR_OBJECT;