Jump to content

how to scatter objects on flip fluid


Recommended Posts

So i have a flip simulation where the water is in a lake and moving slightly up and down the land. I want to scatter some lilypads on it but am not sure how. I tried extracting points from the particle sim using their point id which kept the same points on each frame but ran into issues because i only want particles on the edge of the simulation not in the center of the lake so i was deleting all particles inside of a bounding object but particles were going in and out of this boundary causing newly appearing/disappearing points on some frames. Another problem i had is that not all the particles from the fluid sim are at the surface some are inside but i was able to somewhat get around this with a ray. Just looking for any advice, thankyou!

Edited by Latimerias
Link to comment
Share on other sites

I got something working by initializing an attribute on the first frame where i pick certain points to keep based on their id and then i transfer that keep value to each frame of the simulation so it checks if the particle should stay or not. 

if(@id = point(1, "id", idtopoint(1, @id)) && point(1, "keep", idtopoint(1, @id)) == 1){
    i@keep = 1;
}

Here the first input of the wrangle is the sim and the second is the frozen frame where i manually select points.

Link to comment
Share on other sites

A number of different ways to handle this.

1 create a grid above your surfaced flip sim. Scatter points on the grid. Copy your flat lillypads to the points. Ray the Lilly pads onto your surfaced flip sim. 

2. Create your lillypads as above. In your flip surfacing node there's an option to output a VDB. Instead of rating on a polygon surface. You can use the SDF value and the gradient of the VDB to move the points of the lillypads to the surface of the water. If you were really ambitious you could do this in a solver and actually inherit the velocities from the flip sim

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