Is that possible to save .sim file when simulation is done?

   2301   4   2
User Avatar
Member
14 posts
Joined: March 2019
Offline
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
User Avatar
Member
874 posts
Joined: Oct. 2008
Offline
You could try something like `$F%3` in the file name but you wouldn't know what frame it was unless you store it in a detail att.
--
Jobless
User Avatar
Member
17 posts
Joined: Aug. 2012
Offline
Hi Jisung,

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.

Let me know if this is what you wanted ^.^



Good luck!
Dziga
Edited by dzigakaiser - July 14, 2021 16:21:22

Attachments:
sim_saveLastFrames_dziga.hiplc (742.1 KB)

freelance matte painter & environment concept artist
User Avatar
Member
8785 posts
Joined: July 2007
Offline
set Checkpoint Trail Length to nonzero to keep last N sim files, it should delete others automatically
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
14 posts
Joined: March 2019
Offline
I`m just choice N Trail Length checkpoint simulation

And thank you all! that was really helpful

for me, run some test and let know to common issues all thanks
Edited by Jisung - July 15, 2021 11:59:38
  • Quick Links