Reader small image

You're reading from  Taking Blender to the Next Level

Product typeBook
Published inMay 2022
PublisherPackt
ISBN-139781803233567
Edition1st Edition
Right arrow
Author (1)
Ruan Lotter
Ruan Lotter
author image
Ruan Lotter

Ruan is a 3D Generalist and Visual Effects (VFX) Artist specializing in Motion Graphics, Compositing, 3D Tracking, and 3D Simulations. He currently works as a VFX artist and compositor in the advertising industry and also teaches multiple 3D and VFX-related classes online. He also created the YouTube channel, TunnelvizionTV where he shares tutorials on multiple creative topics.
Read more about Ruan Lotter

Right arrow

Chapter 10: Dynamic Cloth Simulations

In this exciting chapter, we will create clothing for an animated character and add a cloth simulation to simulate the way the clothing interacts with a rigged character. We will also add forces to enhance the realism of the cloth simulation. Cloth simulations are extremely versatile as you can use them for a few different things, such as curtains, flags, duvets, and clothing. Let's get started!

The main topics we'll cover in this chapter are as follows:

  • Importing our character and walk cycle
  • Creating a rest pose to assist with the cloth simulation
  • Modeling the clothing for our character
  • Cloth simulation physics
  • Using forces to enhance the simulation
  • Baking the cloth simulation
  • Adding final modifiers to our cloth simulation

Importing our character and walk cycle

In this section, we will append our rigged Alien character with its walk cycle animation from Chapter 8, Rigging and Animating Your 3D Cartoon Character, into a new Blender project. Appending is an easy way to import objects, materials, and animations from one Blender project into another. Feel free to use a different character if you have one available:

  1. Create a new Blender project, and then select all the default objects in the scene by pressing A. Then, press X and click Delete to delete these objects.
  2. Click File | Append to open the Append dialog box.
  3. Browse to the Blender project file that you created in Chapter 8, Rigging and Animating Your 3D Cartoon Character.
  4. Double-click the Blender project file to display its contents.
  5. Double-click the Object folder to display its contents.
  6. Select both the Alien character model and the rig from this list, and then click Append.
  7. You will see that both the character and...

Adding a rest pose

In this section, we will create a rest pose for our character using the Rigify rig that we appended in the Importing our character and walk cycle section. A rest pose is similar to a T-pose, and it will greatly assist with the cloth simulation later in this chapter. The rest post will also assist us when we model the clothing later in this chapter in the Creating clothing for our character section. Let's get started!

  1. First, we need to see all the keyframes on the rig that we have created for the walk cycle. Click the rig in the 3D Viewport to select it.
  2. Enter Pose Mode by pressing Ctrl + Tab.
  3. In Pose Mode, press A to select all the rig components. This will ensure that all the keyframes are shown in the timeline:

Figure 10.5 – The keyframes for the walk cycle are displayed in the timeline

  1. Move these keyframes to the right to make space for the rest pose. Hover the mouse cursor over the timeline at the...

Creating clothing for our character

In this section, we will model a basic clothing item for our character that we will later use for the cloth simulation. Feel free to follow along or try to create something completely different. It's time to be creative!

Let's get started!

  1. Let's begin by hiding the rig from the 3D Viewport – this will make modeling the clothing item easier. In Object Mode, click the rig in the 3D Viewport to select it and press H to hide it.
  2. Click the character in the 3D Viewport to select it, and then press Tab to enter Edit Mode.
  3. Press 3 for Face Select Mode.
  4. For the next part, I prefer to use Circle Select Mode to easily select certain faces of our character. Press W to toggle between the different select modes until your cursor changes into a circle.

Next, we're going to select the faces from which we will create the clothing item. We will be creating a basic shirt item. Feel free to create your own design...

The cloth simulation

In this section, we will focus on the actual cloth simulation and all the parameters that go with it. Running any kind of simulation in Blender can produce interesting and sometimes unpredictable results, so it's very important that you save your project often.

Simulations are also about experimenting – making small tweaks to certain parameters can sometimes give amazing results, so feel free to make changes to different parameters to see how they affect the simulation. Most importantly, have fun! Simulations are definitely one of my favorite areas of the 3D world. Let's get started!

First, let's give our cloth mesh a material so that we can easily see it in the 3D Viewport, and it just looks better!

  1. Select the shirt mesh in the 3D Viewport.
  2. Click on the Material Properties tab to the right of the 3D Viewport.
  3. Click New to create a new default material.
  4. Scroll all the way down until you see Viewport Display.
  5. Click...

Using forces to enhance the simulation

In this section, we will focus our attention on forces and how to use them with our cloth simulation. Using forces such as wind or turbulence can add realism as well as randomness to our simulations. Let's get started!

  1. Let's begin by adding a Wind force to our scene. Hover your mouse cursor over the 3D Viewport and press Shift + A to show the Add menu.
  2. Mouse over the Force fields and select Wind from the list:

Figure 10.29 – You can create many different forces in Blender

  1. The Wind force field will be created at the location of the 3D cursor. By default, the direction of the wind will point upward on the Z axis. Note the yellow arrow showing the direction of the force:

Figure 10.30 – The yellow arrow indicates the direction of the Wind force

  1. Let's reposition the Wind force. Select the Force widget in the 3D Viewport, press G, and then X...

Baking the cloth simulation

In this section, we will learn how to bake our simulation. Baking refers to the process of saving or caching the results of a simulation to memory or disk. The result of the simulation is automatically cached in memory when the animation is played. If you bake the simulation, the cache data is protected, and you will be unable to make any changes to the simulation until you delete or free the baked frames.

Let's see how we can bake our cloth simulation:

  1. Click the shirt object in the 3D Viewport to select it.
  2. Click the Physics Properties tab to view the cloth simulation parameters.
  3. Scroll down until you see the Cache section:

Figure 10.37 – The Cache parameters

  1. Set the Simulation Start and End frames to your animation length. This means that only frames in this range will be baked into cache.
  2. Make sure you are on frame 1 in the timeline.
  3. Click Bake to start the baking process.
...

Adding final modifiers

In this section, we will add two modifiers to our shirt mesh to make it look better and more realistic. The first modifier is the Solidify modifier, which will give the cloth some thickness. The second modifier will be another Subdivision Surface modifier, which will create a smooth and final look for our cloth.

Let's get started!

  1. Select the shirt object in the 3D Viewport.
  2. Click the Modifier Properties tab to the right of the 3D Viewport.
  3. Click the Add Modifier button at the top and select Solidify from the drop-down menu.
  4. Make sure that the Solidify modifier is below all the other modifiers. This will ensure that the cloth simulation won't take this modifier into consideration when running the simulation.
  5. The default Solidify settings work great. Feel free to adjust the Thickness value to increase or decrease the thickness of the cloth.
  6. The Offset value is set to -1 by default. This means that the cloth will expand inward...

Summary

Congratulations! You have now created a dynamic cloth simulation that interacts with your character's animation. You now have the skills to create amazing cloth-like objects to add realism to your scenes.

You have learned how to append a character model with its walk cycle from another Blender project. You should now also be familiar with creating a rest pose that assists with the cloth simulation and modeling of the clothing item. We also looked at how you can easily model clothing using the faces of your character mesh.

You also learned how to customize the cloth simulation using the physics parameters, as well as using forces that interact with the cloth simulation. Finally, we looked at baking and how to cache our simulation, as well as adding the final modifiers that provide thickness and smooth geometry to our cloth.

Remember that physics simulations are all about experimenting and changing the different parameters until you see good results. Experiment...

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Taking Blender to the Next Level
Published in: May 2022Publisher: PacktISBN-13: 9781803233567
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Ruan Lotter

Ruan is a 3D Generalist and Visual Effects (VFX) Artist specializing in Motion Graphics, Compositing, 3D Tracking, and 3D Simulations. He currently works as a VFX artist and compositor in the advertising industry and also teaches multiple 3D and VFX-related classes online. He also created the YouTube channel, TunnelvizionTV where he shares tutorials on multiple creative topics.
Read more about Ruan Lotter