Jump to content

caching substeps


Recommended Posts

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

sub.jpg

Link to comment
Share on other sites

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/

  • Thanks 1
Link to comment
Share on other sites

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

image.png.9585cbdfb4c28d2e211ecae35820d544.png

 

Edited by ejr32123
Link to comment
Share on other sites

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.

 

cache.png

dop_cache.hipnc

Link to comment
Share on other sites

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.

1.gif?token-time=1608967751&token-hash=C1uLH6oPuVem73-IdKtGCkzyQTpze9EcjbjaF06lW4g%3D

More info on my patreon if you need the tools and more in-depth explanation: https://www.patreon.com/posts/timeblend-sop-30871322

  • Like 2
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...