Jump to content
Sign in to follow this  
mottosso

Interactive Wedge

Recommended Posts

Hi all,

I've explored the various options for wedging, but they all come down to writing results to disk, and I'd like to avoid that if I can as I'd like to run hundreds to thousands of iterations per timestep. The Wedge ROP for example writes multiple versions to disk. Wedge TOP does the same, but in parallel, from a Hython instance each nonetheless. Useful in their own right, but what I'd really like is this.

bullet_loop.gif.fed0555f0e5afc2d05085892fdb794a9.gif

Where I can vary some parameter of my simulation per wedge interactively, without writing anything out. I've got something which "almost" works, like this.

image.thumb.png.000deb4101222ad1e651728ff2981d81.png

But I can't tell whether it's anywhere near success.

What ends up happening makes sense I think, but isn't what I want. That dopnet is singular and I suspect the loop tries increment it multiple times per time step which confuses its internal state somehow. I was hoping I could manually step the simulation, such that I could step it relative the current iteration. But I bet there needs to be unique instances of a DOP network per iteration, such that each can carry its own state. But here I'm at a loss. :S

It's a bit of an XY problem, what I've really like to do is run a number of frames - say 10 - per iteration, measure the result and use it to determine what to change for the next iteration. To make a PD controller, somewhat like you do for machine learning and genetic algorithms, like this one.

Hip file attached if it helps. Any ideas?

 

procedural_wedge.hipnc

Share this post


Link to post
Share on other sites

Not sure what exactly you are doing, but why don't you include your forech inside of the dopnet rather than other way around?

 

Share this post


Link to post
Share on other sites

Hi, 

What you are asking for is exactly what TOP's do. I suggest you to give it a try

Share this post


Link to post
Share on other sites
10 hours ago, anim said:

Not sure what exactly you are doing, but why don't you include your forech inside of the dopnet rather than other way around?

 

I hadn't considered that, I will experiment with that, but it sounds problematic.

  1. At frame 0..
    1. Simulate 10 frames ahead, adding a value of e.g. 0.1 to `max_impulse`
    2. Simulate 10 frames ahead again (ideally in parallel), this time with a value of 0.2
    3. ..then a value of 0.3
    4. ..and so forth
  2. Then determine which of the variations got closer to some goal, of e.g. having the lower body reach a given angle, say 45 degrees
  3. Whichever was closest, continue from that value, e.g. 0.2
  4. At frame 1..
    1. Repeat

For that, I think I need individual DOP networks such that when I get for frame 5000 I could continue from that frame, rather than resimulate it. But you're right, it's not clear what I want, I don't know yet myself. :S

22 minutes ago, polvy said:

What you are asking for is exactly what TOP's do. I suggest you to give it a try

It is, you're right! A "Wedge TOP" along with a "ROP Fetch TOP" is exactly what I'm looking to do, except in SOP/DOP. The hurdle with TOPs is the launch of Hython (adding 5-10 seconds to each work item) and roundtrip to disk (adding 200-500 ms to each frame). I need this to run quicker, as each iteration of my Bullet simulation runs at ~30 ms per frame and I need hundreds of variations for every frame of my animation to determine the next frame.

Share this post


Link to post
Share on other sites
14 minutes ago, mottosso said:

Oh, and I just realised, there isn't a For-Each construct in DOPs. Maybe that's not what you meant, @anim?

I mean in DOPs in Sop Solver, or for short Foreach Loop inside of Solver SOP if you only care about processing the geo over several timesteps

if you don't care about the actual time evolving then you can just do foreach loop and inside For Feedback loop that will loop over certain number of iterations

if it's bullet however then maybe just merge all your setups together, make them separate collision groups so that they don't interact and run them as one sim, since as you noticed you can't run parallel sims without TOPs

EDIT: or if you are adventurous you can have a look at Edit LOP Viewport State where the whole Bullet sim is constructed and run within Python, so maybe you can use something like that 

Edited by anim

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
Sign in to follow this  

×