Demno Posted June 26, 2016 Share Posted June 26, 2016 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? Quote Link to comment Share on other sites More sharing options...
f1480187 Posted June 26, 2016 Share Posted June 26, 2016 (edited) It should work out of the box. Can you upload the HDA or make a sample subnet? Nodes' flags shouldn't be modified usually, use switches instead. Simple $F>1 condition usually works well. time_independent.hipnc Edited June 26, 2016 by f1480187 Quote Link to comment Share on other sites More sharing options...
Demno Posted June 26, 2016 Author Share Posted June 26, 2016 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. Quote Link to comment Share on other sites More sharing options...
f1480187 Posted June 26, 2016 Share Posted June 26, 2016 MMB on node will show an info about time dependency at the very bottom of the info block. 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. Quote Link to comment Share on other sites More sharing options...
Demno Posted June 26, 2016 Author Share Posted June 26, 2016 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! 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.