evanrudefx Posted December 11, 2020 Share Posted December 11, 2020 Caching sub steps using the file cache node doesn't seem like a full proof solution if you want to cache sub steps from such data as a particle sim, etc. For example, I wanted to cache (bgeo) of a particle simulation with 5 substeps. If you look at my photo, you can see that I get frames like 2.200000000000000001 instead of 2.2. I tried everything, I tried setting the substeps to 5, I tried setting the increment to things such as (0.2 or 1/5) but nothing works. Some times it works, sometimes it does not (meaning some frames get the right number and some get long decimals). If I am only doing 2 substeps, it usually works fine. The more substeps you add, it starts to become less stable. Even the documentation says, “The disadvantage of using $FF is possible binary-to-decimal arithmetic errors causing $FF to have a value like 31.99999.” So does that mean there is no way to guarantee 100% success rate when caching substeps? If so, that seems like something that would be worth fixing. Thanks Quote Link to comment Share on other sites More sharing options...
vicvvsh Posted December 11, 2020 Share Posted December 11, 2020 3 hours ago, ejr32123 said: Caching sub steps using the file cache node doesn't seem like a full proof solution if you want to cache sub steps from such data as a particle sim, etc. For example, I wanted to cache (bgeo) of a particle simulation with 5 substeps. If you look at my photo, you can see that I get frames like 2.200000000000000001 instead of 2.2. I tried everything, I tried setting the substeps to 5, I tried setting the increment to things such as (0.2 or 1/5) but nothing works. Some times it works, sometimes it does not (meaning some frames get the right number and some get long decimals). If I am only doing 2 substeps, it usually works fine. The more substeps you add, it starts to become less stable. Even the documentation says, “The disadvantage of using $FF is possible binary-to-decimal arithmetic errors causing $FF to have a value like 31.99999.” So does that mean there is no way to guarantee 100% success rate when caching substeps? If so, that seems like something that would be worth fixing. Thanks Hi, have you read this? https://www.sidefx.com/forum/topic/76644/ 1 Quote Link to comment Share on other sites More sharing options...
evanrudefx Posted December 11, 2020 Author Share Posted December 11, 2020 (edited) 5 hours ago, vicvvsh said: Hi, have you read this? https://www.sidefx.com/forum/topic/76644/ seriously? I have been searching the forums for hours I did not see that!!!!!!! haha, thanks, I will check that out. Edited December 11, 2020 by ejr32123 Quote Link to comment Share on other sites More sharing options...
evanrudefx Posted December 11, 2020 Author Share Posted December 11, 2020 (edited) That doesn't solve the problem because it is saving the wrong frame, so it just gets the wrong frame to a specific decimal. It seems impossible to cache 5 substeps. 2 and 4 work perfectly, but 5 and 10 dont work at all. 5 should work fine, 1, 1.2,1.4,1.6,1.8 Edited December 11, 2020 by ejr32123 Quote Link to comment Share on other sites More sharing options...
vicvvsh Posted December 11, 2020 Share Posted December 11, 2020 1 hour ago, ejr32123 said: That doesn't solve the problem because it is saving the wrong frame, so it just gets the wrong frame to a specific decimal. It seems impossible to cache 5 substeps. 2 and 4 work perfectly, but 5 and 10 dont work at all. 5 should work fine, 1, 1.2,1.4,1.6,1.8 Have you tried? It works for me. dop_cache.hipnc Quote Link to comment Share on other sites More sharing options...
evanrudefx Posted December 11, 2020 Author Share Posted December 11, 2020 @vicvvsh I had tried the hscript (because I don't know python) expression they were using, and that didn't work. I just tried the python thing and that one worked. Not sure why python expression worked and the other didn't. Surely their has to be an hscript way to get this to work. Quote Link to comment Share on other sites More sharing options...
animatrix Posted December 12, 2020 Share Posted December 12, 2020 Hi, I did the same thing a while back using a similar expression in Hscript and Python: { string result = chs("elementname"); string frame = ""; if (strcmp(chs("range"), "static") == 0) return result + ".bgeo.sc"; else if (strcmp(chs("range"), "single") == 0) { frame = pythonexprs('"%04d" % (hou.evalParm("frame"))'); } else if (strcmp(chs("range"), "fullrange") == 0) { if (ch("substeps") == 1) frame = pythonexprs('"%04d" % (int(hou.frame()))'); else frame = pythonexprs('"%04d.%04d" % (int(hou.frame()),int(hou.frame()*10000)%10000)'); } return result + "." + frame + ".bgeo.sc"; } This is to be able to perfectly write and read subframe files. Note that even if you do all this, nodes like TimeBlend won't use your subframe files, so I had to create my own TimeBlend SOP. SESI knows this limitation. More info on my patreon if you need the tools and more in-depth explanation: https://www.patreon.com/posts/timeblend-sop-30871322 2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.