Blender 3D: Noob to Pro/Creating Basic Water animation< Blender 3D: Noob to Pro
Important: Always make the domain after you have already made the fluid and everything else. Subsurf the object that you are currently working on before you create any other object except the domain.
Water and Other FluidsEdit
Water is without a doubt one of the most important compounds in our lives; it covers about 75% of the earth and is therefore incredibly important in quite a few blender animations. Wouldn't it be great if we could get an accurate physical representation of this liquid in blender? We can, using a tool called Fluid Simulation. This tool looks unnervingly complex at first glance, but this tutorial should clear it up for you. At least to a basic level. (Sorry, but I'm not the best with this feature. If anybody sees any missing information that you can help with, please don't be shy to contribute!)
One can imagine how much time it would take Blender3D to think about everything in the infinite space of a 3d world in terms of fluid objects and deflection, so we obviously need to cut down on that size. Create a fairly large cube. This will eventually be set as the volume in which all of the fluid simulation occurs. Don't make it too large, but not too small either. With this cube selected, press "F7" to get to the physics screen. Find the tab that says "Fluid", and click the "Fluid" button to enable the function. Of the six new buttons that appear, click "Domain". All the fluid physics will be calculated inside this cube. Also in that tab, you'll see three buttons, "Std" (which will be pressed by default), "Ad", and "Bn". Each one opens a different set of values. These will be explained as they become important.
- The example animated GIF below uses a domain which consists of the standard cube scaled 10 times. RMB, SKEY, 10, ENTERKEY.
- The fluid can be set to be smaller than this. OBJECTMODE, add, mesh, cube, SKEY, 10, ENTERKEY. Reduce this second cube by half. EDITMODE, deselect all(AKEY), border select(BKEY) top vertices, pull down the vertices to half way.
As a basic start up for your experiments with fluid simulation, I am going to take you through a small demo in which we drop an object into a pool of water, creating a splash. To do this, we need a fluid object and an obstacle object. For the fluid, create another cube, scaled down to cover the bottom of your domain. Enable this object in fluid simulation also and select "fluid". When we start to bake the fluids, this will be set up as your liquid. Make sure you bake this animation COMPLETELY before you add the obstacle. (Don't bake it yet, this will be better explained in the Baking Fluids section)
Let us go over what you have now. You have your starting cube, with the "Fluid Simulation" and "Domain" buttons depressed, and will be referred to as "Domain". Inside this is the cube that covers the bottom of your Domain , which is the liquid. The liquid will be a different object with the "Fluid Simulation" and the "Fluid" button depressed. Create a third object which we will call "Obstacle". This will be the object dropped into the water, and will be described further in the explanation.
Now, create the object you want to drop into the water. Give it an IPO/Animation to drop into the water, and enable it as--you guessed it--an obstacle (click the "fluid" button, click "obstacle").
(User Note: We were just told to bake the animation "COMPLETELY" "before" adding the obstacle, but the baking instructions come in the next section. Are we supposed to bake the animation and then add the obstacle, as it says, or add the obstacle and THEN bake the animation as the sequence of instructions indicates?? *Could anyone out there clean this up a bit?*)
(User Note: He said when you bake it its important to bake the fluid before the obstacle, you are not supposed to bake it until Baking Fluids Step.)
Set up the animation in the front/side views, not the top view. The z-axis is where gravity works. No baking required at this stage. othman
Now we get to see what it all looks like. Before we do anything too fancy, however, go to the render buttons (F10) and specify the total number of frames to simulate the fluid in. Most projects don't need the whole 250 frames. Select the domain object, and find the big button that says "BAKE" under its fluid simulation panel. Press it, click the "continue" part of what comes up, and watch your masterpiece evolve. Be patient, blender has to render this simulation just like it would render the final product. The frame count of this rendering replaces the bar at the top of the screen where it says, "www.blender.org" with the blender logo. If at any time you feel that you want to abort this process, press "Esc". Once the bake is finished, open a timeline window and press play. There, you should be able to view the full simulation.
(note: Make sure the bake data is being sent somewhere or the time you spent waiting will have been for nothing!!)
(User edit: Specify a folder in the space at the bottom for blender to keep the temporal data. Else it will not work) (Note on user edit: When I specify a name and folder, the water animation disappears. ???)
(Yet another User: I tried to Bake my animation, but all it says is something about no images to bake to. I know I need to set a folder or something, but have no idea how!) (You'll get that is you're still in the "Render Options", make sure to go back to the Domain object's "Physics" buttons.)
- As mentioned above, the baking does not work in the render options panel.
object mode, select domain, physics, fluid, bake
- Water splash can be observed with 12 frames only.
- Convert the output of the animation using gimp. Open all files as layers then save as gif.
- Convert into video using Blender's video sequencer. Refer to Blender 3D: Noob to Pro/Using the sequencer to compile frames into an animation
Other Fluid ObjectsEdit
There are two other incredibly useful types of fluid objects--"inflow" and "outflow". The both of these do exactly what they sound like. Inflow objects pour more fluid into the scene, and outflow objects drain it away.
Keep This In MindEdit
Blender will make your water its default opaque grey unless you set its color. A good way to make realistic, clear water (as well as glass for that matter) is to edit the color, then apply a simple mirror effect plus transparency effect. After your water has rendered, select the domain in object mode. This selects the liquid in the frame you have just added. From shading [F5] then the 'Materials buttons' (the button that resembles a ball, if when you click on this the colors settings are not up, just press add new under the only panel there), then the panel called "shaders/Mirror transplants/SSS". Go to the Mirror transplants panel, play around with the settings until you get what you fancy. Suitable settings include [the 'Mirror trans' panel of Material:] click 'ray mirror', set rayMir to 0.1 for water, 0.15 for glass, set depth to 7; click 'ray Transp', set IOR to 1.3 for water, 1.5 for glass; then set the Alpha value to 0 while adding an appropriate color from the "Material" panel.
This tutorial was just a simple example that leaves much to be desired. Below are some helpful links that will further your understanding of the fluid simulator.