broken script to bake keyframes from driver controlled shape keys
Just some syntactic errors (missing indents, etc.). Should work like this:


import bpy

context = bpy.context
scene = context.scene
object = context.object

frame = scene.frame_start

while frame &lt;= scene.frame_end:
    scene.frame_set(frame)
    for fcurve in object.data.shape_keys.animation_data.drivers.values(): 
        object.data.shape_keys.keyframe_insert(fcurve.data_path)
    frame = frame + 1