Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/object/object_relations.c')
-rw-r--r--source/blender/editors/object/object_relations.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c
index 14f88c6d99e..b1c027a2f24 100644
--- a/source/blender/editors/object/object_relations.c
+++ b/source/blender/editors/object/object_relations.c
@@ -57,6 +57,7 @@
#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"
@@ -82,6 +83,7 @@
#include "ED_armature.h"
#include "ED_curve.h"
+#include "ED_keyframing.h"
#include "ED_object.h"
#include "ED_screen.h"
#include "ED_view3d.h"
@@ -546,6 +548,17 @@ static int parent_set_exec(bContext *C, wmOperator *op)
}
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;
@@ -668,6 +681,7 @@ static int parent_set_exec(bContext *C, wmOperator *op)
DAG_scene_sort(bmain, scene);
DAG_ids_flush_update(bmain, 0);
WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, NULL);
+ WM_event_add_notifier(C, NC_OBJECT|ND_PARENT, NULL);
return OPERATOR_FINISHED;
}