Jump to content
GeordieM

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?

Share this post


Link to post
Share on other sites

Not sure I understand correctly: You want the Solvers to automatically re-cook to the desired frame (specified in the Timeshift SOP)?

Share this post


Link to post
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.

 

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×