Jump to content

Cooking/locking nodes on demand?


Recommended Posts

I'm working on a HDA where I need to run two heavy foreach sops on the first frame. After that, I just use the data generated. Is there a way to only cook them on the first frame, or at the press of a button?
I essentially want the nodes to be locked, but unlock and relock after updating, when I press a button on my HDA. I've tried switching past it, but that drops the data. I've tried timeshifting before the foreach so it's now time independant, but it still cooks on every frame.

It really feels like this should be easy and I just can't figure out what I'm missing. Any ideas?

Link to comment
Share on other sites

That is super weird. Your example works perfectly. 

Stepping through my file the foreach nodes run superfast, (so I can't tell if they are actually updating every frame). It's first when it gets merged with the branch that reads in what the foreach generated to do stuff, it gets slow. This is making it really hard to debug and figure out what pieces to extract to a file to upload.

Link to comment
Share on other sites

MMB on node will show an info about time dependency at the very bottom of the info block.

time_dependent_cook.png

All inputs shouldn't be time dependent, all nodes inside loop shouldn't introduce time dependency as well. Just check if output of loop is time dependent (it probably will), then go inside loop and see which node start to show "Time Dependent Cook: Yes". Probably some time-dependent expression was used or time dependent node outside the loop was referenced.

Link to comment
Share on other sites

When stripping down the scene to make a better sample, I think I found my problem. I need to divide my nested ForEach into two. First I need to collect all data from all frames in the range. Then i timeshift freeze it and do the expensive foreach with that data. Now I tried to do it all at once and it just tripped all over itself.

 

Thanks!

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...