I have a script I am working on where I create and add a shape key to an object and add a driver to the value of the shape key. By adding the driver through python it doesn't have any keyframes like a driver would if you manually added it.
I want to be able to add keyframes to the driver's F-curves but I cannot find the data path to access it.
Here is a sample of my script where at the end I would want to insert keyframes:
import bpy context = bpy.context data = bpy.data aobj = context.active_object me = aobj.data scn = context.scene objs = data.objects if me.shape_keys == None: bpy.ops.object.shape_key_add(from_mix=False) bpy.ops.object.shape_key_add(from_mix=False) current_key = me.shape_keys.key_blocks sk = me.shape_keys cur_key = sk.key_blocks cur_key.driver_add('value', -1) drivers = sk.animation_data.drivers cur_driver = drivers cur_driver.modifiers.remove(cur_driver.modifiers)