Insert keyframe to object's Offset Factor Python API I am trying to insert a keyframe at an object's &quot;Follow Path&quot; constraint programmatically. More specifically I am trying to insert a keyframe to the &quot;Offset Factor&quot; property of the constraint. Manually, I would constraint an object to follow a curve, select the desired frame and then right click on &quot;Offset&quot; -&gt; &quot;Insert Keyframe&quot;. However, blender's function:
object.keyframe_insert(data_path=&quot;location&quot;, frame=0)

Does not have a data_path option for the offset_factor. The &quot;location&quot; option is a handle to the object's location at creation (for my case (0,0,0)) and does not change with offset factor change. Is there a workaround or is it not a supported feature? In my code I am trying to set a keyframe at frame 0, offset=0 and at frame 100, offset=1:
constraint_handle.offset_factor = 0
object.keyframe_insert(data_path=&quot;location&quot;, frame=0)
constraint_handle.offset_factor = 1
object.keyframe_insert(data_path=&quot;location&quot;, frame=100)
Keyframe the constraint &quot;object&quot;
Same as [obj.keyframe_insert, bpy.data.particles[&quot;ParticleSettings&quot;].lifetime]; how to insert keyframe to an existed particle setting, e.g lifetime only your object of concern to keyframe is the follow path constraint
Python console code
Object has a follow path constraint with default name
&gt;&gt;&gt; ob = C.object
&gt;&gt;&gt; ob.constraints['Follow Path']
bpy.data.objects['Eye.001'].constraints[&quot;Follow Path&quot;]

Alternatively, all constraints on object of type follow path in a list
&gt;&gt;&gt; constraints = [c for c in ob.constraints if c.type == 'FOLLOW_PATH']
&gt;&gt;&gt; constraints
[bpy.data.objects['Eye.001'].constraints[&quot;Follow Path&quot;]]

Getting by name, will be None if there is no constraint named &quot;Follow Path&quot;
&gt;&gt;&gt; con = ob.constraints.get(&quot;Follow Path&quot;)

Ok, set and insert a keyframe for offset_factor at frame 1
&gt;&gt;&gt; if con:
...     con.offset_factor = 0.0
...     con.keyframe_insert(&quot;offset_factor&quot;, frame=1)
...     
True

True indicating the success of inserting the keyframe