Jump to content

Loop and save particle sim over a number of curves


Recommended Posts

Hi guys,

What would be the best approach in order to sim multiple particles simulations (save to disk) ;particles needs to follow a bunch of curves (one curve at a time)? I have,let's say 10 curves (each curve is driving particle path) and I want to save the particle sim on disk without manually plug each curve into dop to generate the particles? I am talking about saving to disk process,not dop setup.

 

Tks

Link to comment
Share on other sites

Here is how I would approach this:

1. Draw out 10 curves. This will give you 10 primitives. Make a merge node and connect them all in there. After that, connect a null and call it something like "REF_ALL_CURVES" 

2. Make a primwrangle. Create an attrib called something like "prim_id" and make it equal to primnum (i@prim_id = i@primnum).

3. Make a Null and call it something like "CONTROL". Add an int parameter to it called "cluster" or "wedge" 

4. Put a blast node and in the "group" parameter, set it to @prim_id==`ch("../CONTROL/wedge")` and set the entity to "primitives" and "delete non selected". This will isolate one curve at a time

5. Drop another null as a reference point and call it like "REF_CURVE" so you can easily point to it later

6. Do your particle sim as normal. For the curve input, point it to that REF_CURVE null

7. Do your DOP import however you wanna getting the particles out of DOPS. After that lay down your cache node. 

8. Inside a ropnet, or the /out context, put a wedge ROP. Uncheck random samples, and click the + sign to add a wedge parameter. Inside "channel" point it to the parameter on the CONTROL node you made in step 3. Set the range to be 0 to nprims("../path/to/REF_ALL_CURVES")+1 . This will keep it nice and procedural. 

9. In the cache node, make sure to change the file name! Pick whatever directory you like, but make sure to add $WEDGENUM to it so it will write different sims! Here's an example of a path:

    $JOB/geo/magicdust/v001/magicdust_particles_v001_$WEDGENUM.$F4.bgeo.sc

10. On the wedge rop, hit "render wedges". Check the directory to make sure it's all working...

11. To bring them back in, just make a for each (number) loop in sops. Connect a file sop to it.  There should be a 3rd node, the meta import node, which I usually rename to "m" for shortness.

12. In the file sop, construct the same filepath, but instead of $WEDGENUM, do the following:

    $JOB/geo/magicdust/v001/magicdust_particles_v001_`detail("../m", "iteration", 0)`.$F4.bgeo.sc

 

This will load all your sims back in!

 

Good luck! I hope I explained it okay. 

 

 

 

 

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