I can get the frame number of an object’s keyframe from keyframe_point.co[0] from fcurve.keyframe_points. But I can’t figure out how to access the frame number of keyframes belonging to shape keys. Does anyone know where they live and possibly have their home address and a list of their fears?
Stellar. Thanks! I’ve been developing some pretty sweet timeline/dopesheet indicator and keyframe snapping options, works great for regular animation data but not good for shape_key keyframed things until now. For anyone stumbling across this looking how to acquire shape_key keyframes do this:
import bpy
ob = bpy.context.active_object
action = ob.data.shape_keys.animation_data.action
points=[]
for fcurve in action.fcurves:
if fcurve.lock or (fcurve.hide and context.space_data.type == "GRAPH_EDITOR"):
continue
for keyframe_point in fcurve.keyframe_points:
points.append(keyframe_point.co[0])
print('Shape key keyframes')
for p in points:
print(p)