Jump to content
ekan de

Simulating flip from bottle

Recommended Posts

Hello everyone.

Long time since last post here when i was dealing with the same thing.

After watching some tutorials and learning some more in houdini i decided it was time to go back and see if i could get some better results.


There is still some big questionmarks that im seeking answers for.

Here goes.

This is the simulation i want to do.


Animating a beer bottle (prefferable in maya since i have a rigged character and i have made a animation that matches footage so i know that the animation is timed correctly and so on.

The bottle will be pouring beer into a pretty standard glass.

When i have a stable flipsim i would want to go on and simulating bubbles and foam.


So on to the questions.

1. I have noticed some differences between using collision geometry made in houdini or imported geometry.

    Making the geometry in houdini seems to work much better for some strange reason. Can anyone confirm this? It seems that i get away with much higher settings on particle separation and gridscale then using similar objects imported from maya.


2. Scale seems very important here. Simulating in real scale gives a lot of trouble. therefor i scaled the bottle up so that it is around 1 meter high. However, this gives some problems when it comes to actually using the animation i made in maya. Everything in maya is done in       centimeters and when importing it to houdini its way to big. I ended up matching the animation inside houdini from the imported file and used that instead. Wich is the best way to get around this? Usually in production everything is modeled in correct scale in maya.


3. Setting up the flip source. Is this the correct way?

Import the fbx file with the bottle. --> create a new geo node --> create a box big enough to cover the bottle and up to the level where the liquid should end at the bottleneck.

Object merge the bottle into this geo and connecting a boolean with subtract b-a settings.

Then i blast the exterior so i have only the interior of the box minus the bottle.


4. In the bottle geo i have a transform and after that a null. i put the displayflag on the null and then create a deforming object from that.


5. finally i create a static object from the imported glass.


Now all is setup to start simulating. ofcourse there is alot of tweaking of particle separation and collision settings to be done but overall is this a good setup?

I can post a file if that helps.


Finally some other questions.

When caching out the flip to simfiles i only want the particles to be cached. where do i set this up? 

Regarding substeps, if i raise the substeps INSIDE the dopnet on the flipsolver will this generate more substeps when caching it out or is it only the substes on the dopnode that sets substeps in caches?


Sorry for kinda of a long post but if anything can be answered i would be grateful! THX!









Share this post

Link to post
Share on other sites

So some progress has been made.


New questions thou.

1. Why is the collision geo flickering in the flipbook? its like its beeing turned on and of on different frames.


2. I have tried different settings on reseeding to maintain the flip volume but i still get volume loss at the end.

   Somewhat weird that its working good in the beginning but on the ned when there is a much simpler collision to calculate then the bottle it doesnt work.


3. I tried using the gas equalize that someone has mentioned in another thread here but couldnt get anything stable from it. i measured the volume of the mesh i created the fluid from and then put that into the gas equalize node. 

   The result was just an exploding sim.

Here is a flipbook of the sim.




Edited by ekan de

Share this post

Link to post
Share on other sites

This is a great start!

To answer a few of your questions -

1. Maya geo vs Houdini geo. Depends on a couple of things. 

Is the geo from maya, imported, processed, and then cached or are you just directly importing the geo from the FBX? FBX and alembic both sometimes bring in geo as packed geo, poly soups and this brings with it a number of problems. Houdini's geometry format is very efficient. You're going to have a lot quicker results using it. When you bring in your FBX, for your own sanity, never point your sim directly at that FBX. Import it, unpack it if necessary(usually only alembics are packed), convert it to poly, attribute clean it, trail it for velocities, and cache it as bgeo.sc 

2. Scale is everything for flip. 

Small flip sims are always fun. On the one hand, using flip is intuitive and fun and, on the other hand, using flip for small scale simulations is kind of like using an excavator to do the work of a spade. Can you? yes, should you? It's going to be a lot of work and frustration because the tool is powerful but works best on medium to large scale simulations.

Scaling flip simulations to the scale flip operates best at helps for sure BUT you wind up dealing with a lot of strange motion blur issues in the future when you scale things back down for your scene. It's not that this isn't something you can correct for just something to keep in mind because the amount you wind up scaling your object to bring it into flips happy place is .. completely arbitrary and the speed of your animation is again arbitrary. You can't just multiply by X percent because you're after all the cool inner swirly bits n such and bringing those down along with the speed at which your character swings it about means .. two very different numbers and splitting those velocities apart to scale them properly. 

As for volume loss, small quick moving objects and flip don't get along super well. The collision geometry often moves quickly enough that thin walled objects move through a fluid rather than push the fluid along with it which results in volume loss, see the particles flying out the backside of your bottle? There are a couple of things you can do to combat this. 

A. Make your collision volume with thicker than reasonable walls for such any thin walled object. 

B. Make sure your collision volume is calculated on a single frame, just once, and animated. That way it has proper collision velocity and the collision volume does not deform over time.

C. Substeps of course. 

3. For sourcing, I see no reason why this wouldn't work. The resolution of the volume responsible for the boolean is whats going to determine how exactly 100% of the bottle you fill but that seems fine. 

4. Simfiles only caching points doesn't work because they contain the volumes the simulation uses to update the solver so you can pick back up in the middle of your sim at a random frame and move forward. If you just want the points you don't need to cache the simfiles. Just make sure your dopnet is only bringing in "flipobject1" "Geometry" and cache that to disk.


Something to keep in mind, Flip does not recognize that the space the fluid is leaving creates a vacuum. Bubbling back up into the bottle is a big part of the pouring effect and something that I would be very interested in seeing here.

Also always happy to look over the hip file anytime. Do include the geo files for the bottle if they're file references. 

Share this post

Link to post
Share on other sites

Thanks for all the answers. I still havent gotten it to not lose volume at the end. Tried different settings for couple of days now.

As for volume loss, i would think that the volume loss would occur when the bottle is animated and not on the glass that is standing still?  How would you set up a collider with thicker walls? if i make the model with thicker walls only for collision then i will get a problem from the flip particles colliding with that geo if they are spilled on the outside? is there a workaround for that?

When you say that i should make sure the collision volume is calculated on a single frame i guess that you are talking about the glass? This one is a static object created from the shelf tools. 

Not sure i'm making this 100% correct but i locked the geo i use in the file and uploaded it here so you can take a look if you have time. 




Share this post

Link to post
Share on other sites

Hey so I'm not sure if this is a Hiplc problem or not, hopefully someone else can chime in on this but I'm not seeing baked geo in the locked file nodes.

I know this used to work just fine in 16, you could lock a null or whatever to bake the geo into the hip file but I wonder if this changed for 17.5.+?



Share this post

Link to post
Share on other sites

I havent found a solution for getting the geo in the hipfile. Sorry about that.

I have now a flipsim that i am pretty happy with. i introduced a small amount of divergence when it pours to get rid of volume loss.


Next step will be to simulate bubbles. those should be emitted from the collision area where the flip collides with the glass geo.

I know how to get collision data when using pops but can this be used in the flipsolver? would be nice to emit particles that can interact with the flip sim but only from collision area between flip and glass.

Share this post

Link to post
Share on other sites

Btw, if anyone have a answer to why i get the collisions flickering when flipbooking i would be greatfull to hear it. :)

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