Before I try to animate by hand, I thought that the fluid sim could be a solution for liquid in a bottle. As a bottle moves and rotates, I am looking for a way to have the liquid inside natually follow the bottle as it moves and slop around as it is rotated. I cannot find anything on the web on fluid moving inside another object. Does anyone know if it is possible or better still have an idea how to do it?
Set your bottle to be a collision object (or a low-poly proxy for the calculations). Animate the bottle around. Set up a fluid object that has a little time to settle in the bottle before it starts moving. And make sure it all happens INSIDE the fluid domain. Simple example:
Thank you so much for your very concise explanation and example. And thank you for the Bouteille example. This is magic.
For those who download your example, your bouteille file has the fluid leak through the bottle mesh. Read the threads below on strategies to keep the fluid inside the mesh.
I have found that increasing the mesh subdivision without increasing the fluid resolution lets more liquid over flow, so there seems to be a correlation between to 2 sizes.
Lastly, resolution bake times very quickly go through the roof so have sometime to kill
Yea, the baking times on fluids are insane. I occasionally hear of major overhauls coming to the fluid system, but so far it hasn’t seemed to happen. Realflow remains the amazing standard, though Houdini has gotten close. As far as open-source solutions, I don’t know of anything stronger than Blender.
As for fluid leaking, I didn’t have any leak myself (unless you’re referring to how it intersects with the boundary of the obstacle mesh):
This are 192 divisions, but other than that the simulation is unchanged from what I uploaded – baking time was about 2.5 hours for 100 frames.
I got much less leaking when put the resolution 200. On the other hand, The liquid is pixelated. Do you know what settings I have to put to get water? I have the same render as the link below but I don’t really understand what their solution is.
Once you apply a water-like shader to the fluid, it starts to look much better, for what it’s worth.
In your example, they’re using a boolean operator to basically “cut out” the parts of the mesh that aren’t within the bounds of the bowl. I’m surprised that worked so well in their example, as booleans on complex shapes can be messy.
A common method, from what I’ve observed, is to create a mesh that is slightly smaller than the container and use that as the fluid obstacle. This gives you more freedom to tweak bits here and there without upsetting your original model, and it also allows you to use a lower-resolution mesh which helps to speed up the calculation time.
You should do some work on the materials so you get a better sense for whether the “pixelated” look of the fluid is actually going to be an issue in the end. blenderguru has a good tutorial on this, I think: http://www.blenderguru.com/tutorials/create-a-realistic-water-simulation/