How To Pour Liquid & Fill Objects With Liquid | Fluid Simulation Explained In Blender 4.0

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this tutorial we'll learn how to transfer any liquid from one container to another using the fluid simulation in blender it would help if you have some prior knowledge on fluid simulation but we'll briefly cover the basics as well so we have already created two models like this and we have also added an animation to this bottle so that it tilts toward the wine glass and the liquid that we have inside this bottle will flow like this and as a result it will fill in this glass but we have added the key frames to this bottle from frame number 151 because we'll use the first 150 frames to fill in this bottle with whatever liquid we want so we need to add a flow object inside this bottle that will generate the liquid so let's add a UV sphere from the add menu we may need to scale it down so that it fits perfectly inside the bottle or we can directly change its scale factors to say 35 now let's go to the side view mode and then select the UV sphere and drag it to the bottle and place it inside the bottle we need to add fluid physics to the sphere for fluid generation so go to the physics Tab and enable its fluid physics we need to make it a flow type object and the flow type should be changed to liquid the flow Behavior needs to be changed to inflow so that this flow object keeps on generating the liquid continuously until we stop it sometime explicitly so we're good with the other fields but we need to enable this initial velocity it will increase the flow of the liquid that will come out of this object the amount of liquid that we get from this flow object depends on two factors one is the size of this object and another is this initial velocity that we add here so let's use a normal velocity of one but you may need to experiment with a different value for this depending on the size of your container the size of the flow object and the duration of the flow let's go to the wireframe view so that we can see the inside parts now we need to also enable this bottle as an effector because we want the liquid to be confined entirely within this bottle bottle once generated so select this bottle and enable its fluid physics this should be an affector object and the affector type should be Collision then we'll also enable this is planer option it can give us a slightly better result eliminating the chance of any leakage and we need to contain all these objects within a box which is called the fluid domain so let's go to the add menu and add a cube we will enlarge it sufficiently in order to cover all the objects in our scene or we can directly change these scale factors to a three and move it up by the same three units this fluid domain actually holds the liquid that will create or simulate so let's enable its fluid physics it should be a domain type object and the domain type should be liquid then another important field is this domain resolution it controls the accuracy and the Precision of the fluid physics a higher value will give us a far better result in terms of the appearance of the fluid but for now let's go with say 64 otherwise it can take a long time to bake then scroll scroll down to the section called liquid and let's enable this mesh option it will create an actual mesh for the liquid so that later we can assign a material to that liquid now let's change the name of this cache file to Cache instead of the random number for Simplicity and we need to change this end frame number to match with the end frame of our animation which is 600 finally if we play this animation we'll notice a gap here between the container and the fluid and we must remove this unwanted Gap there are two different ways or two things that we can do here to rectify this issue first we can increase the value of this domain resolution it will increase the accuracy and this Gap will reduce further but if we use a very high value in the domain resolution it will take a much longer time to bake and blender can even crash if we don't have an industry level machine so we'll just go with 128 here and along with that we'll use a different object here as the affector which will be slightly bigger in size than this bottle so select this object and remove its fluid physics then press shift d to duplicate it and also scale it up slightly maybe like 15% so we can verify that this second object is slightly bigger in size than the bottle and we'll use this as the affector so even with a gap it will perfectly fill in the inner bottle or the original object but we have too much difference here in the lower part of the bottle we need to slightly reduce the height of the outer object so let's go to the object properties and change the Z scale to 1.1 while the X and Y can remain as it is it will give us a symmetric Gap all around the bottle which is perfect but we still have an unnecessary leg room here at the top of the bottle because we want the liquid to flow just from the corner of the bottle like this so we need to reduce this Gap at the top we don't want the liquid to maintain the usual Gap here and this will be true for any such open end of a container let's also remove these key frames for the outer object that came from the original bottle we don't need them now let's remove this angle to make it upright and then go to the solid View mode we'll cut out the top part of this bottle in order to remove the Gap at the top end so we need to be in the edit mode let's turn on the X-ray view from here and then select the top few rows of the vertices like this now hit X and delete these vertices so the outer bottle will now have a reduced height and we can go back to the object mode Let's then change this angle back to 60 to align it perfectly with the original bottle which is inside we can verify it from here and it looks almost okay but the Gap at the bottom is still higher and same for the top section so we'll further reduce this Gap by changing the scale factor to 1.05 you'll need to experiment a bit with this it must have an equal Gap everywhere and it has to perfectly match the profile of the inner bottle we need to also parent our original bottle to this outer object because we want the second bottle to also tilt along with the inner bottle when it rotates like this so select both of them and ensure that the original bottle is highlighted in orange since it will be the parent now press contrl P to bring this menu and set the parent with keep transform then for the duplicate bottle which is the outer object we need to go to the physics Tab and enable its fluid physics and like before it will be an effector object and will enable the is planer option as well then we need to do the same thing again for the wine glass because we want the liquid to drop from the bottle like this and fill in the wine glass so it has to also act as another refector for this fluid simulation but we won't use this glass directly we'll create a duplicate copy and we'll enlarge it slightly Maybe by 10% there is nothing specific about the size of this outer object you need to experiment on this and find out the best settings for your model so for this outer glass we need to enable the fluid physics the type field should be a factor and we should also enable the is planer option finally we need to control this flow object we need to stop the fluid generation once this container is completely full so let's select the sphere or the flow object and in its fluid physics settings we have to control this field called use flow let's say we first go to frame number 45 here we'll insert a key frame for this and then we'll move to the next frame we'll disable this field completely and insert another key frame so the flow object will generate the fluid only for these 45 frames and this number 45 will depend on the size of your flow object the velocity we assign to the fluid and also the domain resolution you need to experiment with this for the perfect result because if you generate too much fluid it will spill over from the open end of the bottle before any other action can take place so let's again select the cube or the domain object before we start the baking we can see that we are using the flip simulation type and you can customize this field known as flip ratio it controls the characteristics and the behavior of the liquid that is generated by this simulation the default value of 97 is too high it will create create a lot of turbulence and splashes from the liquid so we can use a slightly lower value here let's say we change it to .95 that completes our setup for this fluid simulation we'll just change the cache type from this drop- down list to all we can also enable the resumable option and then start the baking process once the baking is complete we can hide the outer objects both in the viewport as well as in the render we'll just have our liquid domain visible and these two objects also visible we can then play the animation once and verify the result in the next step we have to assign some suitable materials for these objects but there is a catch here we have multiple transparent objects in this scene we have a transparent liquid material which should be visible through a transparent glass and this is something that EV cannot handle very well we have to fall back to Cycles even if it takes time to render let's see how the material Shader is set up for the bottle we have used a principled bsdf with a slight greenish tint and the rest of the fields are like this with full weight for the transmission property we have used a similar material for the wine glass but the tint is slightly on the red side in this case and finally for the liquid material the settings are slightly different and the color for this liquid material is also very bright compared to the glass materials so that's all we have here for the materials it may not look really great an EV as we know about its limitations but if you switch over to the Cycles engine you'll discover that the result is quite impressive now we can render this entire scene and it will look like this it can take a lot of time to render in Cycles but no worries please check our tutorial link below on how to render faster in Cycles using Google collab so I hope you like today's presentation thanks for watching and don't forget to subscribe to this channel
Info
Channel: 5 Minutes Blender
Views: 2,509
Rating: undefined out of 5
Keywords: Blender Tutorial, How to use blender, Blender basics, Blender tutorial for beginners, Blender 3.3, Blender 3.4, Blender 3.5, Blender 3.6, Blender 4.0
Id: wpJHJm5YocU
Channel Id: undefined
Length: 9min 50sec (590 seconds)
Published: Wed Feb 14 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.