# How to save Animation Nodes cache without baking to mesh?

It seems like all caching data from Subprogramm is purged after closing a file, but can we re-use this internal cache?

I was thinking about running few instances of Blender to write Subprogramm Loop cache on different frames simultaneously and then save it for further use. Mainly to speed up the process, as AN doesn't use all CPU power.

P.S. Right now I am saving OBJ sequences splitted between two instances of Blender and converting it to Alembic, which is quite annoying.

EDIT: Trying to implement Omar's solution...

Cube is simply rotating at (0,0,0). I am caching vertices and writing them to dynamic keys. After disconnecting Subprogram from upper Expression I can keep data for 1 full animation timeline. When I want to repeat animation - all data is lost.

There is currently no built-in way to save cache persistently. However, for simple data types, you can store your cache in ID properties in objects. For instance, if you have a vector list vecs that you wish to save, you can save it in an object obj using the expression:

obj["frame_1"] = vecs


And retrieve the data using the expression obj["frame_1"]. You can change the key frame_1 to anything to cache multiple data, per frame maybe. For example, if you wish to save the locations of vertices along frames, you could use the following node tree:

If you now reopen your blend file and use the following node tree, you will get the data you saved:

• Could you please tell where should I place this part with expressions in the nodetree. I feel, like I'm doing it completely wrong. – Serge L Jan 27 at 20:03
• @SergeL Added an example. – Omar Emara Jan 28 at 7:58
• Thank you, but there is still a problem. As I said in edited question, data is stored only for one round of animation (from 1 to 250 it is OK, when it is time to repeat timeline - data is lost). And lost when you scrub timeline backwards. – Serge L Jan 28 at 8:26
• @SergeL hmmm, I don't see why this would be the case. Does the data depend on anything other than the time? – Omar Emara Jan 28 at 11:09
• Cube has driver (frame/16) on Z rotation. Nothing more and there is no other animation in the scene. Interesting thing, that if I reopen this .blend I can see data again but still only for one round. – Serge L Jan 28 at 11:48