I am trying to find the right code to animate text that follows a bezier curve in python blender api. I can add the keyframes, and they appear to be working when I drag through the timeline, but when I run script it sets just one keyframe. I need to be able to tell it the start keyframe at frame 1 and the end keyframe at frame 249. Here is part of the code I am using:
bpy.context.object.name = "Text"
bpy.ops.object.modifier_add(type='CURVE')
bpy.context.object.modifiers["Curve"].object = bpy.data.objects["Circle.Text"]
bpy.context.object.modifiers["Curve"].deform_axis = 'NEG_X'
bpy.ops.transform.rotate(value=1.5708, axis=(1, 0, 0), constraint_axis=(True, False, False), constraint_orientation='GLOBAL', mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1, snap=False, snap_target='CLOSEST', snap_point=(0, 0, 0), snap_align=False, snap_normal=(0, 0, 0), release_confirm=False)
bpy.ops.transform.translate(value=(12.8872, 0, 0), constraint_axis=(True, False, False), constraint_orientation='GLOBAL', mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1, snap=False, snap_target='CLOSEST', snap_point=(0, 0, 0), snap_align=False, snap_normal=(0, 0, 0), texture_space=False, release_confirm=True)
bpy.ops.anim.keyframe_insert_menu(type='Location', confirm_success=False, always_prompt=False)
bpy.ops.transform.translate(value=(-11.6886, 0, 0), constraint_axis=(True, False, False), constraint_orientation='GLOBAL', mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1, snap=False, snap_target='CLOSEST', snap_point=(0, 0, 0), snap_align=False, snap_normal=(0, 0, 0), texture_space=False, release_confirm=True)
bpy.ops.anim.keyframe_insert_menu(type='Location', confirm_success=False, always_prompt=False)
Thanks in advance if anyone can help.