0
$\begingroup$

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.

enter image description here

$\endgroup$
1
$\begingroup$

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:

Save

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

Get

$\endgroup$
  • $\begingroup$ Could you please tell where should I place this part with expressions in the nodetree. I feel, like I'm doing it completely wrong. $\endgroup$ – Serge L Jan 27 at 20:03
  • $\begingroup$ @SergeL Added an example. $\endgroup$ – Omar Ahmad Jan 28 at 7:58
  • $\begingroup$ 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. $\endgroup$ – Serge L Jan 28 at 8:26
  • $\begingroup$ @SergeL hmmm, I don't see why this would be the case. Does the data depend on anything other than the time? $\endgroup$ – Omar Ahmad Jan 28 at 11:09
  • $\begingroup$ 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. $\endgroup$ – Serge L Jan 28 at 11:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.