# Saving Fcurve to a file?

I've been using Blender to create a dataset for a machine vision problem. My current method is randomising the bone rotations of a hand for each frame (using Fcurves with the noise modifier), and hoping to use the Fcurve data and the rendered hands as input and output data, so that I could train a neural network to take in an image of a hand and estimate the rotation of each joint.

The image generation worked fine, but unfortunately I can't find a way to get the value of the Fcurves at each frame. I would be fine with either saving them all as matrices (with a value for every Fcurve at each frame) or save the formulas for them, but I'm not sure how to do either. I've been trying to have a look at developer.blender.org and I've found how noise in the Fcurves are implemented (https://developer.blender.org/rBS4b025d68657c197b302516b96f69405aa957accf) but I don't understand how to read that code, I only work in python and I think it's some sort of pseudocode anyway so I really don't know how to access the functions its referencing. I've been trying to work on this for a while but have gotten nowhere. I would be really grateful for any insight. Thank you.

• fcurve.evaluate(frame)  ? Jul 13 '20 at 11:02
• alternatively set the frame scene.frame_set(frame) and write the posebone.matrix at that frame Jul 13 '20 at 11:12
• The latter is a bit slower, but much safer. It takes into account constraints and drivers, the first one doesn't. Good practice that you presented both, batFINGER. Jul 13 '20 at 12:03
• If you are only after an answer to previous question blender.stackexchange.com/questions/176900/… rather than how to export an fcuve can close as dupe. Re noise see github.com/wisaac407/blender/blob/master/source/blender/blenlib/… Jul 13 '20 at 16:19