1
$\begingroup$

I have a cube

cube = bpy.data.objects['Cube']

The cube has a constraint, follow path. I would like to animate the offset in this constraint. I do know how to edit the value of it, but i need to put in a keyframe. Is there something like:

cube.keyframe_insert(data_path='offset_constraint', frame=10)
$\endgroup$

1 Answer 1

1
$\begingroup$

Right click on the property and select copy data path and use it :

in this case it's constraints["Follow Path"].offset

and the adding a keyframe would be like :

cube.keyframe_insert(data_path='constraints["Follow Path"].offset', frame=10)

enter image description here

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .