setting shape key fcurves from python

I’ve been trying to set shape key fcurves from python in blender 2.5 without any success. I can’t even find out where they’re stored in bpy.context. the closest I’ve come is creating a blank action!
any help much apprectiated,
thanks,
josh

Hallo,
just (changed) and tested this http://dl.dropbox.com/u/8767830/fcurveAnimationSuccess35jul.blend (will stay there a time)

Open it in Blender 2.53
Hit the P
Hit the spacebar
Finisch the game
And the motion is recorded :yes: !

Look at the scripts, how it is done

hey thanks, that looks good for X,Y & Z if they’re part of an action I can find all the fcurves at bpy.context.active_object.animation_data.action.fcurves.values() , and the specific action is subscriptable from bpy.context.active_object.animation_data.action. Unfortunately keyed shape keys don’t seem to show up under actions in either the fcurve editor or in bpy.context.

Does anyone know, have shape keys been implemented in the python API yet?
thanks again

it seems that shape keys can be set like this…
eg.
bpy.context.scene.frame_current=25
bpy.context.active_object.data.shape_keys.keys[“Example Key Name”].value = 0.54323
bpy.context.active_object.data.shape_keys.keys[“Example Key Name”].keyframe_insert(“value”)

the fcurves can be found at:
bpy.context.active_object.data.shape_keys.animation_data.action.fcurves[curve index]
not sure how to establish which f curve corresponds to which shapes though?
modifiers etc it seems can be added through this.
j