Jump to content
Sign in to follow this  
Latimerias

how to scatter objects on flip fluid

Recommended Posts

Posted (edited)

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

Share this post


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

Share this post


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

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  

×