In the preceding chapter, we created a skeleton armature for our Alien Plant. Using a skeleton with a 3D model, you need to tell the 3D software what part of the model needs to follow which joints. You also need to tell the 3D software how much it influences that part of the model, particularly the blend between different joints. This process is called skinning. It is much like the way your forearm skin follows your forearm bone and the elbow skin is a blend between your forearm and upper arm bones. Skinning is also commonly called skin deformation.
All this might sound very complicated to do. Indeed, to do the skinning of a full human or animal character, for example, can be very challenging and time-consuming. However, in this lesson, we will start with the very basics, which are easy to master and will enable you to achieve a lot in your 3D scenes. In this chapter, we will cover the following:
You need to have Blender installed, which can be installed for free from https://www.blender.org/ (at the time of writing). The Blender version in this chapter is 3.1.2, but some older and newer versions will also work.
You will also need a basic understanding of how to navigate the 3D user interface. If you skipped ahead, this was covered in Chapter 1, An Introduction to Blender's 3D Modeling and Sculpting Tools. If you want further in-depth tutorials on how to use Blender, https://www.blender.org/support/tutorials/ is a great resource.
The files related to this chapter are placed at https://github.com/PacktPublishing/Unreal-Engine-5-Character-Creation-Animation-and-Cinematics/tree/main/Chapter12
As I explained in the introduction to this chapter, skinning is where we tell the 3D model how to deform and follow the bones. We need a way to tell the 3D software what part of the 3D model we want to follow, which bones, how much, and how to blend between them. We call this skin deformation, generally. Skinning is applied to the vertices of the 3D model. Editing the amount a vertex is deformed by a bone is called editing its weights.
There are mainly two kinds of skin deformations:
It is the blended deformations where things can get tough in certain circumstances where one vertex can be influenced by not just two, but three, four, or even five bones at the same time. A typically difficult area to skin is around the clavicle area of the human body. There, a vertex can be influenced by the clavicle, upper spine, upper arm, and sometimes, even the neck bone.
However, the basics are simple, and we will learn how to do it with some easy examples. Advanced skinning is beyond the scope of this book, but with some extra research and practice, you too can become good at skinning 3D characters.
Most 3D animation software has skin weight editing tools, but perhaps the most common are skin weight painting tools. Blender also has the ability to paint skin weights. Let's look at a basic example that will teach you how to use this tool.
First, let's learn how to apply the skin modifier to our model in Blender. I pre-prepared a simple file for you that you can load from the files provided: https://github.com/PacktPublishing/Unreal-Engine-5-Character-Creation-Animation-and-Cinematics/blob/main/Chapter12/AlienPlant_Skinning_Introduction.blend
In this file, there is just a simple cylinder with a simple joint chain. Imagine it being an elbow or a knee. If you drag the blue animation timeline at the bottom, the bone also has a very simple bending animation, but the cylinder's skin doesn't follow it yet.
You will see that the cylinder's skin now deforms with the bone when we drag the animation timeline. Blender did most of the work for us by using automatic weights, as shown in Figure 12.3:
However, we can edit this using weight paint if the automatic weight results are not good. Next, we will see how it works.
To edit the skin or see the weights in the viewport, while the cylinder is selected, switch to Weight Paint mode, as shown in Figure 12.4:
Now, let's explore the basic Weight Paint setting on the Properties menu; under Active Tool, you will see the Weight Paint tool settings, as shown in Figure 12.5:
There are lots of Weight Paint settings but for the scope of this book, we will just get started on the essentials that are used the vast majority of the time.
The most important is Brush Settings:
If you look at the 3D model, you'll see it is rainbow-colored. The colors represent the weights of a selected bone (the amount it follows a selected bone) and its vertex group (the vertices assigned to it).
In simple terms, this is what the colors mean:
If you look at the Blender documentation, it gives you a chart, as shown in Figure 12.6. This is how the colors and weights are laid out:
However, to really understand this in practice, let's do an exercise.
Follow these steps to edit skin weights with painting:
You'll notice that when you select Bone (the root bone), the bottom is red, and the top is blue to reflect the weight. The root bone on the world floor is influencing the bottom part of the cylinder 100% (red) and the top of the cylinder 0% (blue).
Now, if you select Bone.001 (the top bone), the top is red and the bottom is blue. This is the opposite of the previous. The top part of the cylinder follows the top bone 100% (red) and the bottom 0% (blue).
Notice that the middle stays green in both cases because it's a mix between the two bones.
Let's do some weight painting:
You'll see the vertices move. As you do this, the vertices will become solid red as the weight you are painting builds up with every stroke of the brush. Keep doing this while navigating around the cylinder to paint all sides of the middle vertices till they're all solid red, as shown in Figure 12.10:
So, now we've painted the weights, the only problem is that if we drag the animation timeline to frame 30, the bend doesn't look very good anymore because all the vertices in the middle bend part are rigidly weighted to the root bone, as shown in Figure 12.11:
Let's paint some of the weights back to Bone.001 for a more natural bend.
Note
Even though the skinning is better now, you'll notice that we're losing some volume towards the bend as it narrows towards it, which we didn't get when Blender did the automatic weights originally. Losing volume on the bends is a common issue with painting skinning. The quick fix is to switch between vertex groups and paint 100% weight on the two edge loops that maintain the volume (as shown in Figure 12.15). This is followed by blur painting the middle edge till it's even between the two outer loops.
Here are some additional notes to further improve the skinning:
To get the skinning perfectly right is sometimes a long and laborious process on a more complex model. To experiment and practice is the best way. There are also other skinning tools available that are outside the scope of this book, but there are many resources available to learn more. However, with this basic set of skills, you can do a decent job of skinning most 3D models.
Now that you have a basic understanding of how skinning works, let's skin our Alien Plant.
Now, for the final part of this chapter, we'll finally get to skin our alien plant. Your plant might be different from mine if you modeled it yourself in the previous chapters. Your skinning results might be different from mine and might require more editing. Since you have learned the basics of skin weight painting in this chapter, you should be able to fix any problems that come up. If not, load the file provided (https://github.com/PacktPublishing/Unreal-Engine-5-Character-Creation-Animation-and-Cinematics/blob/main/Chapter12/EndOffChapter11_Results_AlienPlant_withSkeleton.blend)
so you can proceed with the rest of the instructions.
We'll use the skeleton we created earlier and skin our Alien Plant to it. To do so, follow these instructions:
Congratulations, you have successfully skinned your Alien Plant! This is a big step forward in your journey through this book.
In this chapter, you've learned how to do skinning and how to edit skinning with weight painting, and finally, you have skinned your Alien Plant to your skeleton. If you enjoyed this process, this is the very first step in becoming what they call a character rigger in the industry, a specialized job for people who enjoy skinning and rigging characters for games and movies. Even if this process is not one of your favorites, it's important to learn how to do it if you want to create new animated content on your own as a generalist.
In the next chapter, we will use what we have learned so far and create a skeleton and skin for our robot character.