Now that we have a good understanding of how the rigid body simulation works in Blender, let’s take everything we learned in the last chapter and apply it to a real project!
In this chapter, we will be learning how to use the rigid body simulation to create a full physics-based animation.
We will start by learning how to create a wrecking ball and a domino effect. Then, we will move on to animating materials, creating an elevator using constraints, using animated rigid bodies, adding hinge constraints, and finally, we will be destroying a tower of cubes to finish off the animation.
The goal of this chapter is to understand how to use the rigid body simulation in a practical way to create a nice satisfying animation! Here are the topics we will cover:
This chapter requires you to have Blender version 3.0 or above installed.
To download Blender, visit www.blender.org.
Also make sure to download the setup file for this tutorial here: https://github.com/PacktPublishing/Learn-Blender-Simulations-the-Right-Way/tree/main/Chapter11.
Before we get started, make sure to download the Rigid Body Course Setup.blend file. This will include a basic scene, with some models and materials already in place and HDR for lighting. Each object is named accordingly, so it’s easy to navigate.
Once you are familiar with the scene, we can go ahead and start creating the simulation. If you would like to download the finished scene, Rigid Body Project File.blend, for reference, you can do that as well!
Working with Complex Rigid Bodies
When working with complex rigid body simulations, Blender tends to crash and be unresponsive. Remember to constantly save your Blender file throughout this tutorial so that you don’t lose progress if and when the program crashes.
Let’s get started by simulating the wrecking ball crashing into one of the blue cubes! To do this, we’ll use the rigid body Object menu to add physics to all the chains at once:
Figure 11.1 – Wrecking ball physics
Figure 11.2 – Wrecking ball settings
Figure 11.3 – Damping values
Figure 11.4 – Chain top settings
Normally, the Passive type is used for platforms or bigger surface areas; however, Active with Dynamic turned off is better for more complicated meshes.
From here, you will be able to play the animation and the wrecking ball should swing! Next up, let’s create the domino effect!
Creating this domino effect is actually very easy! All we have to do is select each of the cubes in the circle and click Add Active in the rigid body Object menu.
Figure 11.5 – Selected cubes
We don’t need to change any settings in the Physics panel; the default values will work perfectly fine for these objects. Also, another important step is to select the Floor object and select Add Passive in the rigid body Object menu. This way, the cubes stay where they are and don’t fall through the floor!
Feel free to change the shape of the domino line to how you like. You could have it go all the way around the scene or split off into two directions! Just make sure that it eventually comes around and hits the Button Cube object because this is what triggers the elevator to go up, which we will talk about now!
Before moving on, this is a good time to save the Blender file (you should do this regularly as you move through the chapter).
Next up is the elevator that carries the sphere to the top of the course. To create this, we will be using a motor constraint! Let’s first start by animating the button on the Button Cube object to turn green when the last domino hits it:
Figure 11.6 – Frame 120
Figure 11.7 – The Material panel
Figure 11.8 – The Emission Color keyframe
Figure 11.9 – The button turning green
Figure 11.10 – Elevator settings
Figure 11.11 – Locked properties
Figure 11.12 – An empty constraint
This constraint will have X, Y, and Z directions. Keep the rotation of these directions in mind when working with constraints!
Figure 11.13 – The Motor settings
Figure 11.14 – Motor constraint rotation
Make sure to play the animation to see whether everything is working properly and the platform is rising.
Figure 11.15 – Animating Enabled
On the next frame (120), turn on Enabled and add another keyframe. And there we go – the motor constraint won’t turn on until Frame 120 when the last domino hits the button!
Figure 11.16 – Generic constraint settings
Before you play the animation, make sure to save your Blender file again. After that, play the animation, and make sure that everything works properly and the elevator rises into the air!
Upper and Lower Values
If the elevator stops too early, you may want to change Z Lower to a value of -6 m in the generic constraint settings. This is because the upper and lower values are determined by which object is active when they are connected.
Figure 11.17 – The elevator rising
Next up, we will animate a cube smacking into the sphere and shooting it along the platform!
When the sphere reaches the top of the elevator, we are going to have a cube slide out and hit it, sending it around the half circle! To do this, follow these instructions:
Figure 11.18 – The Cache panel
Now, the simulation will last for 500 frames rather than only 250.
Figure 11.19 – Cube Hit physics
With the Cube Hit object selected, let’s press I and add a Location keyframe on Frame 230.
Figure 11.20 – Hitting the sphere
Over the course of five frames, the cube will extend outward and smack the sphere, sending it around the half circle.
Figure 11.21 – The platform settings
With that done, let’s move on to creating the Hinge constraints!
The last obstacle for the sphere to go through, before it crashes into the tower of cubes, is a series of walls that rotate using the Hinge constraint. To add this, do the following:
Figure 11.22 – The wall settings
Figure 11.23 – The Hinge constraint
Figure 11.24 – Z angled down
For this tutorial, I will be rotating the constraint and placing it at the top of the wall. Feel free to change it however you like!
Figure 11.25 – Adding walls
And now, we get to the fun part of this project – collapsing the tower of cubes!
Adding physics to the 2,880 cubes that are piled up on the right side is very simple to do, so let’s go ahead and get started:
Figure 11.26 – Cubes selected
Figure 11.27 – Deactivation
Since the cubes have a slight gap between each of them, they will fall down just slightly at the start of the animation. This could cause some of the cubes to move around or fall. Turning Start Deactivated on will ensure that they don’t simulate until the sphere crashes into them.
Figure 11.28 – The Cache panel
Once the bake is finished, you will be able to play the animation and see your simulation in real time! Play through it and make any changes you like. Maybe add some of your own obstacles to the scene!
Figure 11.29 – Frame 384
You could have the sphere hit another button, releasing multiple spheres that crash into the cubes, or maybe add in some force fields to totally mess with the rigid bodies. Use your imagination and have fun with it! Once you are happy with the simulation, we can move on to the Camera animation!
For the Camera animation, we basically want to follow the progress of the simulation: starting out with the wrecking ball, moving up the elevator, following the Sphere around the half circle, and finally zooming out to see all the cubes collapse.
There are two main ways to move the camera around:
Figure 11.30 – Camera to View
You can use whatever method you prefer!
Now, let’s start animating the camera:
Figure 11.31 – Depth of Field
F-Stop controls how strong the depth of field will be. Lower values will make the background blurrier. Let’s set this to 1.0.
If this part is a little tricky for you, you can download Rigid Body Course Project File.blend for reference here: https://github.com/PacktPublishing/Learn-Blender-Simulations-the-Right-Way/tree/main/Chapter11.
Now that the camera animation is done, let’s finish this scene by changing a couple of render settings in Eevee!
In the last part of this tutorial, we will set up some Eevee settings and really make our animation stand out and look good:
Figure 11.32 – Ambient Occlusion
The difference that Ambient Occlusion makes to the render is significant and can really help improve the look!
Figure 11.33 – Ambient Occlusion
Figure 11.34 – The Motion Blur settings
And that is it! From here, we can render the animation! Head over to the Output panel and set a directory for where you want your animation to render. I recommend rendering this animation as an image sequence just in case of any crashes. If you don’t remember how this is done, refer to Chapter 4, Creating a Waterfall Using Mantaflow.
But there it is! We have now created an entire rigid body obstacle course! This doesn’t have to end here. You can add more obstacles or other things to the simulation. For example, you could add a Wind force field at the end to push all the red cubes off screen, or have the sphere object trigger something that causes multiple spheres to crash into the tower!
Another cool idea would be to animate the speed of the simulation when the sphere crashes into the tower. This could give a cool slow-motion effect! It’s all up to you and your imagination!
Hopefully, at this point, you have a good understanding of the rigid body simulation in Blender and feel confident about creating your own scenes and animations! You can always come back to this chapter or the previous one if you need a refresher.
Let’s do a quick recap to establish everything we learned today. First, we discussed how to create a wrecking ball using rigid bodies. From there, we added in a domino effect and animated a material. We learned about motor and hinge constraints and how to use them practically in a simulation. After that, we applied the rigid body to thousands of cubes and simulated them all at once. Finally, we set up the camera animation and render settings and exported the animation.
The rigid body simulation in Blender is very powerful and can be used to create many different scenes and animations. So, go play around with it and create your own simulations! This is also the end of part three of this book. In part four, we will discuss a topic that not a lot of people know about – dynamic paint!
18.191.164.195