I want to save .sim file when simulation is done or crashed or user stopped simulation.
saving whole simulation 1~end is waste of disk and simulation time I guess so, i want to save only simulation is done and last 2~3 frame only.
Is that possible? I`m really struggle with simulation is crashing or run out of ram (Because while on simulation i`m doing something else with simulation pc)
I hope this possible and I think dopnet cache to memory option is saving simulation file to memory so it`s seems possible to save simulation only last frames
I felt like trying to tackle your issue from another angle^.^ Attached you find a file with a Python based solution.
What it does: 1. When a frame is cooked, it adds the sim file name to a log file in the simulation directory. 2. It keeps the last X names in the log (you choose how many you want to keep in the Python SOP). 3. When a frame cooks, it deletes all other sim files except the last X amount.
What you have to do: 1. Connect the Python SOP to your dopnet, so it cooks each frame. 2. In the very top of the code section you see "USER INPUT". 2a. Add the path to your dopnet output node with which you save the sim files to disk. 2b. Enter the number of files you wish to keep (default = 3)
Known issue so far: 1. When you re-cache a sim that is still in memory, it seems to save the files to disk without cooking the Python code and thus not deleting files. 2. I would disable the Python SOP whenever you are not caching to disk. Otherwise it might get confused about which files to keep because of the way I wrote the script. Could be optimized ^^
The rest should work as is. In case you encounter errors, don't hesitate to contact me. I only tested on my Windows workstation with the simple file I uploaded. There might be issues with other OS or file permissions, though it should work for Linux as well.