From the course: Learn Animation Production in Blender 2.9

Setting up inverse kinematics - Blender Tutorial

From the course: Learn Animation Production in Blender 2.9

Start my 1-month free trial

Setting up inverse kinematics

- I noticed in the last video that I forgot to name these two bones. So let's do that. I'm still in edit mode here. So let's just select one, hit F2, and this I'll call ship main. And this one let's call ship bounce. Let's do that. All right. So we have all the bones that we've created so far named over here in the outliner. That's good. Now we need to come over here and set up what's called inverse kinematics in this joint chain. You can control a chain of bones, whether it be like for a leg or an arm of a character or for a landing gear here in two different ways. You can control it using inverse kinematics and you can control it using forward kinematics. Now forward kinematics means that we're going to adjust the limb beginning at the base, adjusting this joint, and then maybe rotating this joint and rotating this joint until we get the end of our chain in the proper place that we want it. However, inverse kinematics means that we create a control object for the end of the chain. And when we move that control object, Blender automatically adjusts the rotation of the joints so that the end object, the control object, can be wherever we place it. It's like if you're shaking someone's hand and you grab their hand and you move that hand around, it's also moving their wrist, their elbow, and their shoulder, and those joints adjust automatically, depending on where that person's hand is. So we're going to be using inverse kinematics so that we can control it with an object at the end of the chain. So, first of all, what we'll need is an IK object, an IK control, say right down here at the end of the chain. To do that, I'm just going to duplicate this bone here, this leg front three. So I'll press shift D and hit enter. And now you can see that name now has a 001 on it. So let's hit F2 again, and instead of leg front 3 001, let's change this to leg front IK for inverse kinematics. There we go. Now that we've done that, let's break this out of the parenting hierarchy. So as we've created this and extruded these bones out, this bone is a parent of this bone, and this one is a parent of this one. And therefore the leg front IK is also a child of that leg front 02. So we need to break this out so it's not part of that hierarchy. To do that, we can just press alt P. Now, if you come up here to the armature, you can see that we've got parent here. To create a parent or to make a parent relationship, we can press control P, and to clear it, you can press alt P. So with that leg front IK selected, I'm going to press alt P and I'll choose clear parent right there. Now you can see that object has been broken out of that chain of bones for the leg there. And it's out here under the armature. All right, now let's create that IK chain. Let's switch to pose mode instead of edit mode. If we come up here to this edit, pull down and we can change from edit to pose mode. And now if we select that leg front 03, I'm just going to click here again. So we've switched to that 03. We can come over and apply a bone constraint. I'm going to click here. And if we add a bone constraint here, we can choose inverse kinematics. There we go. Now, the first thing we need to do is create a target. And for this, we're going to select armature, and then we want a bone. And the bone we want for this is that IK bone that we just created. So I'll click that there. Now we need to tell it how many bones in the chain there are going to be. So we're actually going to want two bones in the chain, that leg one and leg two. So for the chain length, I'm going to increase that from zero to two. And then you can see that we've got this leg three bone attached to the tail. Well, we can come over here and uncheck use tail, and that will put that bone back where it originally was. And also, I'm going to uncheck stretch. We don't need that here for this kind of armature. All right, so what has that done for us? Well, if we come over here and click here again, this is like that IK bone, and then I hit G, look at what happens. We can move that chain around. Just like if I were shaking someone's hand, it's moving their forearm and upper arm around automatically as the hand moves. So I'm going to hit escape to go back to there. Now, another thing we're going to need is a rotation constraint, because as you can see, if I select that IK and hit G, the actual leg three bone and the IK bone do not stay together. And I'd like those to stay together. So what I'm going to do is, once again, select that leg front three, and let's add another bone constraint. So I will click here and I'm going to add a copy rotation constraint. And then once again, we want to choose for the target the armature, for the bone, the leg front IK. And there we go. Now let's give it another try. I'll click here, choose the IK bone, hit G. And look at that. It stays clamped to the IK bone. Now we can always pull it away, but that's not really a problem here. We just want to make sure that the rotation stays the same. All right, I'm going to hit escape again. And now we want to create a control object that we can select to control the foot of the landing gear, as well as the top of the landing gear to move it up and down. And I think I'm just going to create a simple circle object that we'll then use as a control object. So let's move this cursor back to the center of the grid. I'm just going to press shift S, cursor to world origin, and then I'll press shift A and let's go to mesh and circle. And there we go. Now we've got a circle there. Let's call this circle underscore CO or control object. There we go. So this is just going to be an object we're going to use to create those control objects. It's ultimately going to be hidden away. So let's come back over to our armature. I will go back to pose mode and I'll hit the period key and zoom in over here. Now if we select this object right here and come over to our bone panel, we can come over here to viewport display. We scroll down, we see this section called custom shape, and here's where we can apply that custom object. Now, actually, what I do need to do is select that leg front IK bone, and we're going to basically change the shape and look of this bone to that circle. So, first of all, with this selected, I'm going to change the custom object. I'm going to click here and I can type in this search field. I can type CO, and here's that circle control object. I'll click here and there it is. So it's basically replaced that IK bone with that circle object, but it's at an angle and I want it down here at the base of the foot. And that's why we created this bone here. So what we're going to do is use that as the override. I'm going to click here and let's choose leg front, bottom control object. And there you go. And now that snaps it to the base of that foot. Now we can click and drag on the size and maybe make the size of the control object a little bigger. So mine here is at 1.9, and I think that looks pretty good. Now let's do the same thing up here, let's select this bone right here. Let's come over to the custom object. We'll type in CO, here's our circle control object here. Once again, it replaces the bone, but it puts it at the same angle and we don't quite want that. So I'll come down to the override field, click here, and let's choose that leg front top control object. And there we go. Now I can click and drag in the size field and bring that down. So maybe right about here. So mine's at about, let's type in 0.6. There we go. Okay. So what have we done here? Well, now if we take this control object in pose mode and hit G, that'll move that whole chain around. And likewise, if I click here and hit G I can move this whole thing up and down. Now notice that when we move these, if I hit G again and move it up, the control doesn't come along. So if I grab this, right, that control stays on the ground. So we need to actually parent these bones to the bones that are actually moving around. To do that, let's go back to edit mode over here. And what I'll do is I'll select this bone. And then let's select that IK bone, which is right here. I'm just going to press control and click that. Now let's parent this to this. So the IK bone is going to be the parent of the control object bone. So control P and I'm going to parent it, keeping the offset here so that it stays in the same place rather than snapping over here and connecting to that bone. Let's do the same thing up here. I will select this bone, I'll shift click this one, and then I'll press control P and keep offset. There we go. So now, if we go back to our pose mode, now if we select this and hit G, now that control moves along, right? And if I select this one up here and hit G, that one moves along as well. All right. In the next video, we will duplicate this joint chain over here and we'll move it back to here. Then we will parent the actual objects of the landing gear to the rig. So that's coming up next.

Contents