Access animated curve handes and control point after deformation (shapes and modifier

I have to export animation data of a curve deformed by shapes, modifiers and armatures.

This is somehow similar to https://stackoverflow.com/questions/9138637/vertex-animation-exporter-for-blender but for curves (so not only I need the vertex but also the handles).

I can access static curve data by using for ex.

o = bpy.data.objects['Curve']
hr = o.data.splines[0].bezier_points[0].handle_right
hr = o.data.splines[0].bezier_points[0].handle_left
co = o.data.splines[0].bezier_points[0].co

I could not find how can I get the deformed data?

Thank you!
Riccardo

Further thoughts:
copying the mesh, applying modifiers, export each frame is the only solution i see but I still have to test it.

And, even in this case, I don’t know how to apply shape keys.

yes, I guess you need to work on a copy of the curve and apply your deformation modifiers there… and use_apply_on_spline active so you don’t deform the generated mesh but the curve

to apply shape keys manually you can create a new shape key from mix, set its mix value to 1, remove every shape key starting from the top… now the trick is to do that from python

Thank you liero!
I’ll test and report my find.
Ric

ps. I wrote to you: https://blenderartists.org/forum/showthread.php?282824-SVG-output-script&p=3234376&viewfull=1#post3234376