In Chapter 3, Let's Sculpt an Alien Plant, you learned how to model and texture the Alien Plant. Now it's time for us to prepare it for animation and to finally give it some life. Most 3D software offers many different ways to animate models. Among these, two are the most common.
The first way to animate a 3D model is by directly moving, rotating, and/or scaling it. This method is best suited for simple animations involving a rigid model. The second method uses a skeleton (sometimes called an armature) that is linked to the structure of the model.
Unless it's a very simple animation, the animation is normally better done using skeletons. The skeletons of 3D models are made up of bones. Just as bones in a real skeleton define the overall shape and mobility of a person, the bones of a 3D model skeleton correspond to the underlying structure, therefore defining which parts of the model can move in animations.
You will notice that some 3D software refers to bones as joints. This may seem confusing at first but think of them as joints in a real skeleton; by the end of this chapter, you will see that it is just another way of looking at the same thing.
In this chapter, we will cover the following:
You need to have Blender 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 also need to have 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/Chapter11
Like many things in life, it's all about preparation. Before we can do anything, we need to prepare our 3D model to set us up for success. Here, we will learn how to import and prepare our model for the best results. This is also the best practice way if you were to work in a team or a studio with other artists.
The model of the Alien Plant can be imported into Blender via the FBX format. This is a universal file format used by most 3D software packages, including UE5, Blender, Maya, and 3D Studio Max. FBX has limitations and will not contain some program-specific things. It is mainly used to transfer 3D assets from one 3D program to another for further work.
To import your Alien Plant model, simply follow these steps:
Before moving on to the next step, and as a general note, it is best practice to make sure that whatever the model is you want to create a skeleton for, the model is positioned as perfectly as possible in the middle of the 3D scene, also commonly referred to as the origin of the scene.
It's also better if the 3D model is facing straight as perfectly as possible in one of the 3D scene axes (X, Y, and Z directions) while the bottom of the model is on the ground. For example, the Unreal Engine Mannequin model would be positioned as shown in Figure 11.4. His feet are on the ground, perfectly at the origin, and he is facing directly on the Y axis:
You will notice that in Blender, the feet of the character are on the floor (0 height) and where the green and red lines cross is the origin of the scene (0, 0, 0 coordinates). Left-clicking on any model, in this case, the Mannequin model, on the right side of the screen, you can see the Transform tab. If you don't see it, click on the Object Properties icon indicated by the red arrow. Notice that Location and Rotation are set to 0, 0, and 0, and Scale is set to 1, 1, and 1. You can change those numbers by clicking on them and changing them.
It's best practice (and recommended) that you set those values as such to move your model's local pivot to the world origin. However, if your model is then sticking through the floor, or has the wrong orientation or wrong scale, you can fix that easily. Your model's scale should also be correct before you create a skeleton for it.
Before moving on to the creation of the skeleton, let's look at the Alien plant again. Let's examine whether it is positioned and scaled correctly. The model is on the floor and since it has irregular branches, it is facing the best it can in a flat forward direction. However, how about the scale? Let's check. This can be done in several ways.
A less accurate way is to import a human character (such as the UE Mannequin) into the scene and scale the other 3D objects to match the relative human scale visually. I often do this just to double-check that things look in proportion to my correctly-scaled player characters.
The easiest and most accurate way to check the scale of an object in Blender is with the Measure Tool, as shown in Figure 11.5:
You can now see that this particular Alien Plant model is about 11.5 meters tall. Your custom-created plant might be of a different scale, so this is just for illustration. For our final scene, we want it to be just a bit taller than a human, so about 2.2 meters to 2.4 meters, as shown in Figure 11.6.
Tool Note
If you still have the cube in the scene that opens with a standard Blender scene, you can delete it at this point, since it's not needed and will most probably only get in the way.
Important Note
The reason we do this is that it makes the creation of the skeleton, skinning, and rigging much easier. It keeps things nice and tidy and is generally just good practice if you work with other artists in a team. Having a skinned model with non-default scale and transform values might be confusing later.
Also, once a character is skinned, it becomes very hard to scale the model afterward in some 3D packages. In Unreal Engine, it's not such a big problem, but it's still better to have the correct scale before skinning in case you need to use other 3D packages in your pipeline later.
You've learned how to import a .fbx model and check the world position and scale. After making sure your self-modeled Alien Plant is positioned optimally in the 3D scene, it's time to move on to the next step. Alternatively, import the Alien Plant model provided in the book materials: https://github.com/PacktPublishing/Unreal-Engine-5-Character-Creation-Animation-and-Cinematics/blob/main/Chapter11/AlienPlant.fbx.
Next, we will learn about parent/child relationships in 3D software.
Before we start creating the skeleton itself, I just want to take a moment to explain the parent and child concepts, also called the hierarchy in 3D programs.
Parent/child hierarchies in 3D software are explained with the simple concept that a child always follows the parent as they walk around when the parent is holding the hand of the child.
However, if the child pulls away, the parent doesn't follow the child. Now, imagine a family: the parent and four children, Child A, Child B, Child C, and Child D. They are connected in the following way, as shown in Figure 11.9:
Skeleton hierarchies work in the same way as these parent/child relationships. Figure 11.10 shows an example of the standard UE Mannequin hand skeleton in Maya. I chose to show it in Maya because it is visually a bit easier to understand the relationship between the joints.
The little circles are the actual joint pivots. The elongated triangular lines are the parent/child linkages, with the thicker part of the triangle on the parent side and getting thinner as it points to the child. Most 3D software displays it in a similar way:
They work the same way in Blender, but Blender displays the parenting a bit differently at times and it can be visually a bit more confusing at first glance when a custom parenting is created. However, it's nothing to worry about, as you will see in the rest of the chapter as we make our skeleton.
Now that you understand child/parent hierarchies, we can move on to making the skeleton.
Blender is just one of the many 3D software packages that can be used to create skeletons and joints for your models or characters. Most use roughly the same kind of workflow, with some small differences. In Blender, skeletons and their bones are created under a grouping called Armature, named after the wire supports used for stop motion animation and inside some sculptures. Blender might not refer to them as skeletons but in the industry, more generally, people just call them skeletons.
Everything is now ready to create our Alien Plant skeleton. Blender has some oddities in how it displays the hierarchy in the viewport with parenting, but in reality, it is the same as most 3D packages in structure.
As we mentioned earlier in the chapter, in Blender, skeletons are grouped under the name of Armature. Now, let's learn how to make one for our plant:
At the bottom left of the screen, an Add Armature menu will appear. Here, we can check the unit scale. If needed, change this to 1 m so the bones are bigger and more visible on the screen, as shown in Figure 11.12:
This will display the skeleton bones over the 3D models so it's easier to work with. Axes will display the axes (local orientation) of the bones. In some cases, this is very helpful to see this in the viewport, so it's a good habit to switch them on.
You can see your Armature group and Scene Collection in the viewport, as shown in Figure 11.14.
Note
If the armature doesn't appear at the origin of the scene, you probably need to reset the 3D cursor back to the world origin. The armature will be created on the cursor like other objects. You do this by using the drop-down menu at the top left of the screen: Object | Snap | Cursor To World Origin.
Next, I like to keep the first bone, or what we call the root bone, at the origin of the scene. This bone will be a good overall parent for our entire skeleton at the origin of the 3D scene later in UE, but the bone is visually a bit too big, so let's scale it down.
However, there's a problem. We want RootBone to be the overall parent of our entire skeleton so all the other bones follow RootBone. At the moment, the bone hierarchy itself is what we call flat. Both RootBone and StemBone01 are on the same level in the hierarchy, so neither will follow the other. Let's fix that:
In the viewport, the parenting is indicated with a dotted line, as shown in Figure 11.24:
We have now learned how to do custom parenting if needed. Now, let's learn a way to make a longer joint chain quickly.
We now need a longer skeleton parent/child chain to do the main stem of the Alien Plant. Instead of repeating the previous steps one by one till we have a long enough chain from the bottom of the main stem to the top, we will use the special Extrude function for bones:
The easiest way to do this is to select and move the little spheres at the top of the bones. You can also select the main bone and move it if needed, but it behaves differently. Feel free to experiment as shown in Figure 11.27:
Important Note
The aim of creating this kind of skeleton is for the bones to run down the middle of the main stem at regular enough intervals so we get nice deformations once it's skinned. Once you have done a few, you will start to get a feel of where the best places are to place the bones in future projects.
After moving the bones according to the stem profile, it should look something like Figure 11.28:
Make sure to navigate around the 3D model to check that the bones are well-positioned inside the main stem. If not, make small adjustments till you're happy with the placement.
We now have a full bone chain for the main stem of our Alien Plant. Next, we will explore how to create additional bones for the branches as part of the same skeleton.
To make the branches, we're going to use Extrude and Subdivide. The latter is another one of the techniques available and is very useful to make quick joint chains:
This will subdivide the bone into two equal pieces, as shown in Figure 11.32:
We have now built a skeleton for our Alien Plant and we are ready to move on to learning about skinning in the next chapter.
In this chapter, you've learned how to prepare 3D models before you create skeletons for them with some industry best practices. You've created a skeleton for your Alien Plant and got a deeper insight into how it works. You are well on your way to creating custom animatable characters.
In the next chapter, we will learn all about skinning and how it works.