Jump to content

Definitive way to lock Solver SOP output at frame number


Recommended Posts

Hi all, I'm create SOP HDAs that internally use Solver SOPs for calculations.  The end result is not time dependent, the Solvers are part of a generative system and the user can set number of iterations in the HDA UI.

I use Solvers instead of For loops since they're easier to visually debug while developing the system.

I've been using the Timeshift SOP and exposing the Frame parm to the HDA to set number of iterations.  I then disable caching on the Solver SOP and put the Timeshift directly after it. This kind of works, but if you say set the Frame parm to 500 it will process the solver to that frame, but then if you set it back to 400 it won't refresh the graph downstream.  I'd like to avoid scripted calls to force node cooking etc.

What's the definitive way of locking the output of a solver to a specific frame and not have the output cached in any way?

Link to comment
Share on other sites

Exaclty! :)

Here's a quick demo scene

Solver_Time_Lock_Test.hipnc

On the Solver_Test obj there's a "Solver Iterations" int slider.  If you push that up you'll see the number of points increase, if you pull it back down they won't decrease till you hit 0 then it force the cache to clear as per the "Enable Automatic Resimulation" option on the DOP sop inside the solver SOP.

I want a way to completely invalidate the entire cache whenever the local time of the solver is changed without forcing any node cooking via scripts.  I'm working on my own custom solution as well but thought there might be an easier solution.

 

Link to comment
Share on other sites

AFAIK there's no way to make this work without scripting. (If there is, I'd be curious to know aswell). As a sloppy workaround, you could expose the "reset Simulation" button of the SOP Solver to your HDA.

Using for-loops would solve this issue, I think. You said it's easier to work on the system using a solver, but maybe you could port the logic to for-loops for the final HDA? That would be my approach.

Link to comment
Share on other sites

Yup that's exactly what I'm doing now re For loops.  If you set the Iterations parm of a For loop to $F and Gather Method to Feedback you basically turn a For loop into a Solver (obviously some nuances to this).  I then have a toggle in the HDA to use a specific iteration as output or override with current time to simulation a Solver SOP for development.

 

Thanks for the validation Florian!

Edited by GeordieM
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...