Book Image

Learn Blender Simulations the Right Way

By : Stephen Pearson
2 (2)
Book Image

Learn Blender Simulations the Right Way

2 (2)
By: Stephen Pearson

Overview of this book

Blender is a free, open source 3D software that allows you to create stunning visual graphics, animation, VFX, and much more! This book is an in-depth guide to creating realistic and eye-catching simulations, understanding the various settings and options around their creation, and learning how to troubleshoot solutions to your own Blender problems. In addition, this book can also be used to simulate the behavior of certain physics effects, such as fire, fluid, soft bodies, and rigid bodies. You’ll learn how to use Mantaflow, an open source framework within Blender software, to create fire, smoke, and fluid simulations. As you progress, you’ll understand how to easily produce satisfying rigid and soft body simulations, along with cloth simulations. Finally, you’ll use Dynamic Paint, Blender’s modifier, and the physics system to create eye-catching animations. By the end of this Blender book, you’ll have created a number of animations on your own, such as a campfire, waterfalls, and explosions. You’ll also have gained a deeper understanding of all the simulation options in Blender, which you can use to create portfolio-ready animations.
Table of Contents (21 chapters)
1
Part 1: Using Mantaflow for Fire, Smoke, and Fluids
7
Part 2: Simulating Physics with Soft Bodies and Cloth
12
Part 3: Diving into Rigid Bodies
15
Part 4: Understanding Dynamic Paint in Blender

What you need to create a simulation

In short, there are two things you will always need for a Mantaflow simulation, as follows:

  • A domain
  • A flow object

We will look at each in more detail, along with effectors, which are not mandatory but are still useful.

Domain objects

A domain object is a container for the entire simulation. No gas or liquid will be allowed outside this domain. When the simulation gets close to the edge, it will either collide or disappear, depending on what setting you have set.

The bigger the domain, the more resolution you will need

This will cause the simulation to bake longer. A general rule is to have the domain just big enough to fit the simulation.

The domain object is always going to be the shape of a cube. Even if the domain isn’t a cube, the simulation will treat it as one and will simulate outside the original mesh:

Figure 1.7 – Domain example

Figure 1.7 – Domain example

The sphere in this example is the domain and, as you can see, the fluid is going outside the mesh. It is probably best to only use a cube as the domain for any simulation. As I stated earlier, you can also see the resolution of the simulation by viewing the size of the little box in the bottom-left corner.

To assign a domain, go to the Physics panel and select Fluid | Type | Domain.

Flow objects

Flow objects are used in simulations to either add or remove fluid from the domain. It’s important to note that the flow needs to be inside the domain to simulate properly; having it outside will do nothing.

Unlike the domain, with a flow object, you can have any shape you want but it needs to be a (mesh object). This means that (curves), (metaballs), (empties), or other objects like that will not work:

Figure 1.8 – Flow examples

Figure 1.8 – Flow examples

We will cover flow objects in detail in Chapter 2, Understanding Domains, Flows, and Effectors, but I wanted to provide this example so that you can understand how they work. In the flow’s properties, you can change its Behavior. There are three options you can choose from. This will affect how the smoke/fluid is emitted into the domain:

  • Inflows: This will constantly add fluid to the simulation (left)
  • Geometry: The fluid added is based on the exact amount of geometry of the mesh itself.
  • Outflows: This will delete the fluid

To assign a flow object, go to Physics Properties | Fluid | Type | Flow.

Effectors

Effector objects aren’t necessary to create a simulation, but they can add another level of detail and interest to your simulation. They are used to collide and deflect or change the physics and velocity of the fluid.

So, if you want to create a collision for your simulation, effectors are the way to do it. When you add one in, just like the flow, this object needs to be a mesh. We will cover effectors in detail in the next chapter.

To assign an effector object, go to Physics Properties | Fluid | Type | Effector.

To summarize, there are two types of simulations that you can create with Mantaflow: either a gas or liquid simulation. When you decide which one you want, the next step is to add all the objects you need, those being a domain and a flow object. Do you want multiple flow objects? Do you want to add any collision objects to give more interest to the simulation? There are an endless number of simulations that you can create and it’s up to you to decide what you want to do.

In the last part of this chapter, we will be creating a fire simulation together. Step by step, we will learn exactly what it takes to create fire using Blender and Mantaflow. So, strap in, open Blender, and let’s get started!