Blender Rigging - Setting Up an IK Arm Rig

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey everybody johnny here in this video we're going to take a look at how to set up the rig for a mechanism like this where we have an inverse kinematic arm that also has some pistons that look like they're moving the arm let's get into it we're going to go ahead and start with this model i haven't added an armature yet and all of the pieces of this model are separate objects each side of the pistons are their own separate pieces each arm segment is separate and this first arm segment is combined with the base here let's go ahead and add our armature i want my armature to start at the center of this base so what i'm going to do is select this ring of faces with an alt left click then pressing shift s for my snapping menu i'm going to say cursor to selected the cursor is now in the middle of all of those faces from here i'll press shift a and add an armature i'll tab into edit mode and grab the end of this first bone i'm going to drag it up so that it reaches the pivot point of our second arm i'll then extrude it and then finally i'll extrude this last one again this is the initial bone setup let's go ahead and parent our three arm sections to this armature i'll select the first one and then shift select my armature i'll press ctrl tab select my first bone and press ctrl p i want to parent this arm to the bone now i'm going to drop out of pose mode by pressing ctrl tab choose my second arm and then shift select on my armature again i'll press control tab to go in back into pose mode and i'll select the second bone again i'll press ctrl p and choose bone i'll do the same thing for the last arm now my three arms are parented to the bones that represent them so if i rotate those bones the arms move with them one thing you'll want to do is when you're moving these bones around make sure that you're in pose mode not edit mode if you move them in edit mode you're going to be changing the base position of the bones and you don't want to do that now we haven't done anything with our pistons yet so let's go ahead and see how we're going to handle those first let's look at this bottom piston connected to the first arm i want to add a bone for it whose pivot point is the center of this piston i'll go back into object mode select this piston and i'll do the same thing i did for the base i'll alt click to get this ring of faces and then do shift s cursor to selected now i can go back to edit mode of my armature by selecting it and just hitting tab if i press shift a now i'll add a new bone where my cursor is i'm going to move this bone so it lines up with the end of my piston if i hit ctrl tab now and go into pose mode if i rotate this bottom bone you'll see that my new piston bone doesn't do anything that's because it isn't parented to anything so hitting tab i'll go back into edit mode i'll select this piston bone and then i'll select this first bone i want this piston bone to be the child of this bone so i'll hit ctrl p i get a new menu here keep offset or connected if i choose connected the root of this second bone will go to the tip of the first bone and that's not what we're looking for so i'll press ctrl z i'm going to press ctrl p again and this time i'm going to say keep offset this means that the relationship between this bone and this bone is this distance now if i press ctrl tab and go back into pose mode and rotate this bass bone you'll see that the piston bone moves with it now since the top of this piston is connected to the second arm let's go ahead and do the same thing with that one i'll select my piston grab this ring cursor selected go back into my armature press ctrl a move this down and then parent this one to the second bone i'm going to go ahead and do that with the remaining two pistons there now if i go into pose mode and i move any of my bones you'll see that my piston bones move with them now i'm going to parent my piston parts to my piston bones there now if i move my bones you'll see that my piston parts move with the arms now that we've got everything set up we want the pistons to be more realistic in a real setup like this the pistons are what are actually contracting or expanding to move the arms but in our setup we're gonna have the arm movement move the pistons one of the things with pistons like this is that the ends are always in line with each other and they're always pointing at each other we can use this fact to our advantage we're going to add some bone constraints to these pistons so that they're always pointed to one another this is how that looks the first thing i want to do is i need to know which bone that i'm working with while i can see my currently selected bone here i don't know right off hand what this one is without clicking on it now i see it's bone four in order to see all of my bone names i'm going to go to the armature menu under viewport display choose names now i can see my bone names and that's going to help me out next with this bottom bone selected i'm going to go to the bone constraint properties window and i'm going to add a bone constraint the bone constraint that i want to use is called damped track this one points a bone to a target by using the smallest rotation necessary and that's what we want in this situation the target for that track is going to be this second bone because we want this end of the piston always pointed to this end of the other piston part so i'm going to choose my armature and then i'm going to choose bone 4 now you'll see that this is pointed to this end we want to do the opposite thing now with the other end of the piston so i'll select that bone add a damp track armature bone three now for simplicity's sake i'm going to change my bone display from octahedral to stick that makes them a lot smaller so that we can see our model as we can see because we've lined these up well that this end is pointed this way and the other end is pointed this way so if i were to move this second bone my piston works as expected next i want to do the same thing with my second piston now as we move our arms our pistons look like they should at this point we've created what's called a forward kinematic rig that means that we move each arm to the position that we want it and then that movement propagates forward through the chain so if i rotate this first arm it rotates the next two if i rotate this arm it only rotates the next one and if i rotate the last one only the last one moves while forward kinematics are really good for certain situations other times we want the whole arm to move to point to a target and we don't want to have to specify the movement of the whole rig to do that we use an inverse kinematic rig in an inverse kinematic rig we have a target and then the rest of the bones line up so they point to that target i'm going to clear out the rotation of these bones and i'm going to add another bone we want this bone to be rooted at the end of our last bone but we don't want it to be connected so i'm going to go into edit mode for my armature selecting the tip of this bone i'm going to press shift s and go cursor to selected from there i'll press shift a to add a new bone to make it a little easier to see i'm going to grab the end of this new bone and just drag it out to the side like this if i go into pose mode and grab this bone you'll see that it's not connected to anything for an inverse kinematic rig we create a chain and we add an inverse kinematic constraint to the last bone in that chain in this case that's going to be bone002 there's two ways to add an inverse kinematic relationship the first is to choose the bone that you want to add it to go to bone constraints and add inverse kinematics then we choose the target of that inverse kinematic in this case it's going to be bone 007 of the armature i'm going to remove this constraint by clicking the x and i'll show you another way you can achieve the same effect first select your target bone then select your bone that you want the inverse kinematic added to once you've done that press shift i this will ask to add an ik to the active bone you'll see you get the exact same thing you get the inverse kinematic constraint added to the this bone with its target being the first bone you selected now once we have this added if i move my target bone you'll see that the whole rig moves of course while parts of it look right parts of it certainly don't that's because we have a fully unconstrained inverse kinematic system going on here in fact if i move this sideways you'll see that this is even moving in a way that it shouldn't hear i'll clear the position of this bone by pressing alt g to make this work right we're going to have to add some extra constraints to our bones so that they only move certain ways when they're influenced by an inverse kinematic first let's look at this root bone when i moved my target you'll see that the base is swiveling but it's swiveling in a direction that doesn't work it should only be swiveling around the base like this it should not be rocking side to side or front to back if i choose a bone in pose mode and then go to my bone properties window you'll see that there is a section called inverse kinematics the first thing we want to look at for our bones is inverse kinematic locking this means we can tell it that the bones should not move in a certain direction but how can we tell which direction is which the x y and z here refers to the x y and z of our bone we can see the x y and z of our bone by going back to our armature menu and in the viewport display turning on axes for the moment i'm going to turn off names if we look at our base bone we can see that we don't want this bone to rock side to side on its x-axis or side to side on its z-axis we only want it to spin around its y axis so that means we want to take this bone and we want to lock its x and z rotation so under the inverse kinematics tab we'll lock the x and we'll lock the z now if i move my target you'll see that it only spins in that way and doesn't rock side to side like it was before next we need to look at this joint we don't want it to spin this way and we don't want it to spin this way we only want it to spin on this z-axis the one coming in from the side so we want to lock this second bone on the x and y axis and we'll see because we extruded these bones that it's also the z axis on this next bone that we want to be able to move so we'll lock the x and y axis on this bone as well now that we've locked those three bones let's go ahead and move our target again and there we have it just moving our target bone now moves our entire rig without breaking any of the physicality of our rig so the arms aren't moving in directions they shouldn't be however let's take this one last step further if i take this rig grab this end and push it all the way up like this you'll see that our pistons are colliding with themselves in ways that they shouldn't so in addition to our bones not being able to bend in certain directions we want to also set some limits to how far they can bend i'll press alt g to reset my target bone and let's first look at this bone if i grab my target bone and pull it all the way down you'll see that this piston pulls too far so we don't want this bone to be able to go this far the bone we're talking about here is this second bone if i go to my bone menu and go down past my locks you'll see that i have limits for the x y and z and a minimum and a maximum if you've locked an axis those choices are grayed out so we only have the choice to limit the z i'll turn that on now if i increase the minimum this big circle will start to decrease and once it gets to where the bone currently is it will start affecting that bone i'm going to pull this up until it reaches the point that i don't want this arm to go past let's say right there now in addition let's grab this and push it all the way up again we're in a situation where this has gone too far so here i'm going to reduce the maximum so now i have a sweep of where this arm should be able to go if i grab my target and bring it back down you'll see no matter how far up or down i bring it that second bone is not rotating past where it should of course we have the same problem with our last bone let's go ahead and put it to an extreme position choose our last bone and limit the z rotation i'll bring up the minimum let's say to here we'll grab the target and bring it up to the extreme other end we'll then reduce the maximum and so now we have the swing of this arm now that we've done this we see we have some much more workable constraints on our rig and it's going to be a little harder to make our rig do something that we don't want it to do one of the nice things we can do with this rig now is we can hide a bunch of these bones because if we only use this rig in inverse kinematic mode we never need to see any of these other bones we just need to see our target we're going to select all of the bones except our target press the m key and then move them to a different bone layer let's just say though this one here as you can see in our layers layout on our armature tab we see that we have bones on this layer if we select that layer we can see them but here we just have our target bone in this first layer and that's all we need to do an ik animation with this i hope this video was helpful i know that rigging can be kind of tricky and i'm no expert to say the least sometimes we just need a jumping off point to try a few new things to see if we can get them working i hope you can use this idea in some of your projects and i hope it inspires you to make something awesome once again thanks for watching the channel thanks for sticking around thanks for subscribing so until next time i'll catch you later
Info
Channel: Johnny Matthews
Views: 97,813
Rating: undefined out of 5
Keywords: Blender, Rigging, Inverse Kinematic, Bones, Armature
Id: vZaNZhAoMts
Channel Id: undefined
Length: 16min 57sec (1017 seconds)
Published: Sun May 01 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.