600 likes | 713 Views
SE 313 – Computer Graphics. Lecture 14: Armatures Lecturer: Gazihan Alankuş. Today. Armatures and Bones Weight painting. Animations. We learned how to set keyframes for positions/orientations/scales for objects Well then, how would you animate something like this?.
E N D
SE 313 – Computer Graphics Lecture 14: Armatures Lecturer: GazihanAlankuş
Today • Armatures and Bones • Weight painting
Animations • We learned how to set keyframes for positions/orientations/scales for objects • Well then, how would you animate something like this?
Animating Complex Meshes • Why is it difficult? • There are so many vertices and edges. How are you going to manage their motions?
Animating Complex Meshes • You need to be able to say “rotate your arm” without having to deal with individual vertices. • It also needs to know how to get back to how it was before • How can we do all this?
Idea • Our muscles move our bones, to which our flesh is attached to
Armatures • Similarly, we use a skeleton structure in computer graphics • They are called armatures (or bones) • They are much simpler than actual skeletons
How armatures work • Remember the robot that you created? • Body parts formed a hierarchy by parenting parts to each other • Children were attached to parents and when parents moved children moved with them • Similarly, armatures are created as a hierarchy of bones, like an actual skeleton.
How armatures work • However, the armature moves • Changes the relative rotation between bones • Actually gets displaced • The model needs to move accordingly • Different parts of the model should follow different parts of the armature • The model has to deform as a result
How armatures work • The armature has many bones • We need to identify which parts of the model will follow which bones of the armature
How armatures work • We can identify parts of the model through weight painting. • For each bone, you mark parts of the model with weight values • When the bone moves, parts of the model will also move, proportional with their weights for that bone
How armatures work • As a result, the model deforms in ways that follows multiple bones.
How armatures work • This way, we can animate the armature and the complicated model will follow it • We don’t have to deal with individual vertices!
Practice • Creating armatures in Blender • Using armatures to deform models • Using envelopes • Using auto-weighting • Through weight painting
Creating armatures in Blender • Create a new scene and remove the cube • Create a single-bone armature using the menu
Creating armatures in Blender • Now look at the different modes available when we select the armature • We edit the armature’s details in edit mode • We move and animate the armature in pose mode
Creating armatures in Blender • Now switch to edit mode • Notice that there are three parts of the armature that we can select • The root • The head • The tail
Creating armatures in Blender • The root is not very important, it moves with the head of the topmost bone • The head defines where the bone is attached to. You rotate the head. • The tail is where the next bone can be attached to. It also defines the length of the bone.
Creating armatures in Blender • Now select any part of the bone and click Extrude on the left • When you move the mouse now, you see that you are adding a new bone. Click to position it. • You can also add a new bone using Ctrl+click
Creating armatures in Blender • You can create multiple branches by selecting a middle bone and adding a new bone using Extrude or Ctrl+left click
Creating armatures in Blender • In edit mode, you can move heads and tails of bones as you wish. • If you look at the Properties pane on the right, you see where they are located. • As you move bones, you see their sizes change because the distance between the head and the tail changes. It’s ok.
Creating armatures in Blender • When you go to Pose Mode, you can only rotate these bones or move the whole armature using the root bone. • This is how you will animate them
Creating armatures in Blender • Just like animating other objects, you set rotation keyframes using the I key and animate the armature in time
Creating armatures in Blender • You can only rotate bones around their heads and the heads seem to be attached to tails • You can make heads not attached to tails
Creating armatures in Blender • To make a bone that is not attached to parent’s tail • Select the bone in edit mode • Go to the Bone tab on the right • Uncheck Connected • Now you can move the head freely
Creating armatures in Blender • However, they still rotate together when you rotate the parent bone
Creating armatures in Blender • When you switch between edit and pose modes, you may notice that your armature takes on different poses • This is because the edit mode shows the armature in its default pose • You can select which pose you want to see in the object data tab
Creating armatures in Blender • There, you can also change how the bones will appear
Creating armatures in Blender • Notice that when you render, bones don’t show up (cube added to prove that the camera is looking at it) • This is because bones are there only for deforming meshes, not for visual display
Practice • Creating armatures in Blender • Using armatures to deform models • Using envelopes • Using auto-weighting • Through weight painting
Preparing the armature and the model • Let’s create a simple armature and a model • Create a new blender scene, remove the cube and add an armature
Preparing the armature and the model • Add three more bones to the armature vertically • To make them aligned vertically, switch to front view before creating the bones • In edit mode, use Extrude or Ctrl+click to create the three extra bones
Preparing the armature and the model • Now, switch to object mode and lets add a cube • Scale it down a bit to your liking
Using armatures to deform models • Go to edit mode and select the top face • Move it down to make the cube shorter, then extrude many times so that we have a long box with many vertices
Using armatures to deform models • Now we can’t see the armature. We will make it so that the armature is always visible • Select the armature in the outliner • Under the object data tab, select X-Ray • Now the armature is always visible. You can select the armature after selecting the box.
Using armatures to deform models • Now we want to try different ways of making the armature deform the model. • This is why we want to save the current state of our model so that we can go back to it. • Save it as initial.blend • Then save it again as backup.blend in case you overwrite it!
Method 1: Envelope weights • Select the cube and shift+select the armature to select them both • Select parent with envelope weightsas shown below. • You will have to select it one more time…
Method 1: Envelope weights • Now the cube should move with the bones, but we did not set things up correctly, yet. • Try it by selecting the armature, going to pose mode and rotating the root bone • You may or may not have somevertices follow the bones
Method 1: Envelope weights • We need to set envelopes correctly to fix this • Go to edit mode and object datatab • Select envelope under display • Now the bones look different. When we select a bone, we see a white halo around it. • This is its envelope. If the vertices are in this envelope, they will move with the bone.
Method 1: Envelope weights • To modify these envelopes, go to the properties pane and change the radius and envelope values
Method 1: Envelope weights • Make sure envelopes are large enough to completely cover the vertices
Method 1: Envelope weights • Now go back to pose mode and rotate the bones. If you see bad vertices, go back to edit mode and increase envelopes
Method 1: Envelope weights • Save this as envelope.blend • Now we want to try another method • Open initial.blend that we saved before.
Method 2: Automatic Weights • This is an easier way to set up weights for the mesh • Select the cube and shift-select the armature.
Method 2: Automatic Weights • Set parent with Automatic Weights. You have to select it again.
Method 2: Automatic Weights • Now try pose mode. Wasn’t it easier?
Method 3: Weight painting • We will learn one last method for cases in which we want more control over the weighting. • Re-open initial.blend again
Method 3: Weight painting • Select the cube only and add an armature modifier to it
Method 3: Weight painting • Select our armature as the Object • If you try pose mode now, it will not work. We need to tell Blender how this armature modifies the mesh • We will do this by painting weights