Jump to content

Access simulation Substep from within SOP Solver


Recommended Posts

Hey guys, trying to figure out something that's probably simple (I hope). I'm making a small edit to the sopsolver inside a POP source object. Just adding a wrangle to ignore some points, sometimes. Specifically, per substep. Unfortunately I can't figure out how to get the substep number from my wrangle. 

To recap, I have added an extra wrangle into the SOP Solver inside a POP Source node. Trying to access what substep the sim is on, and @SimFrame doesn't work (which makes sense). How should I do this?

 

Thanks,

-M.

Link to comment
Share on other sites

create a parameter on your wrangle or anywhere in your SOP Solver and use this expression to get

simulation time

stamp("..", "ST", 0)

timestep

stamp("..", "TIMESTEP", 0)

or simulation frame

stamp("..", "ST", 0)/stamp("..", "TIMESTEP", 0)

they will be only valid during siming, but you can set their defaults to nonzero if you want the to be specific values when observing inside of SOP Solver

Edited by anim
Link to comment
Share on other sites

Anim, thank you so much. Unfortunately that doesn't seem to be working and I'm not sure why. There may be something fundamental I'm misunderstanding. 

Essentially, I have different groups of points and I only want one to emit per subframe. So I'm using a wrangle to delete all the other points when it's not their turn to emit. i.e.

if (@ptID != ch("subframe") % 6){
    removepoint(0, @ptnum);
}

Where "subframe" is my parameter with the aforementioned expression. Unfortunately the stamp never seems to pull in the data, so it just sits at the default value and never changes. Maybe my POP_source doesn't have the ST variable?

Link to comment
Share on other sites

".." would not point to POP Source, but SOP Solver, if it's on the parameter on the wrangle inside of SOP solver, but it shouldn't make a difference if it did though

here is a simple file of similar setup that you probably have (SOP Solver inside POP Source) to show evaluated values as attribute

I added another SOP Sover in there just to see it isolated, if you are using POP Source's SOP Solver that's fine too

subframe_inside_sopsolver.hip

Edited by anim
Link to comment
Share on other sites

Thank you so much for taking the time to put that together for me. I really appreciate it.
Reading back over your first reply I imagine my problem is coming from something here

Quote

 

"they will be only valid during siming, but you can set their defaults to nonzero if you want the to be specific values when observing inside of SOP Solver"


 

So perhaps I really am getting it to evaluate on each substep, but the result ends up being that particles are only ever emitted from the same group (whatever the default value of the expression is). It sounds like I probably need to put my wrangle in the POP Solver instead of the POP Source.

Link to comment
Share on other sites

you just have to trust it

if you look at my example, you can clearly see that the substep value is being stored as an attribute, however you will never see any value other than 0 in the parameter itself

so the same way I'm using the value in there you can use it to do whatever, since you see that it evaluates to the correct values during simulation

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