Rigging with Inverse Kinematics (IK) in Blender - Mechanical Arm

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
greetings Hobbies this is Einstein's of all and in this video we're going to have a look at how to rig this Servo arm we're going to do that in two ways one way you can move the parts around individually and probably the more exciting is using inverse kinematics so you can move it around just using one point allowing you to pose it quickly and easily so blender actually makes rigging relatively easy as long as you know the tricks to it but there are some complexities to this and for this video we're actually going to ignore these servos and this tube that is going to be in the second video so if you're not subscribed do subscribe and press that Bell button so you know when the video is up or if you're interested in checking out the patreon as these fantastic people have that video is already up on patreon because we're a week ahead so you get more awesome blender videos and you get them ad free so there are a few tricks to rigging up things especially mechanical objects and we'll go through those as we talk through them but I'm gonna have to jump around a little bit slightly at points just to make sure everything's clear and the first is that especially for mechanical components you want your points in of your rigging to be exact otherwise certain things especially inverse kinematics are not going to work very well for example if I was to press shift and a and start with bringing that Armature and I press single bone and that will bring it in here so you'll notice that it's not visible at the moment if I go into x-ray mode you can see it this actually isn't perfectly on the spot where we want it to be we would want this somewhere here otherwise when we join this to the later part somewhere up here then this isn't going to actually be directly vertical which is going to cause some problems when we come to constrain it so I'm actually going to undo that and we're going to have a look at how we can get our cursor in exactly the point we want it to be what you want to do is you want to make sure that you've got some things that are identical on both sides if possible for example if I go into vertex mode I can alt select and shift alt select this circle here and exactly the same one on the other side and if I press shift and S I can then put put my cursor to those vertices and that will average out to the perfect center now I'm using machine tools which is what gives me this cool Pi menu to flip in and out of the different modes quickly and that also gives me this shift s menu for the cursor and origin if you don't have Machine Tools you're going to have something that looks like this instead so I'll just turn that off so you'll get something that looks like this and yeah it's a mess and horrible but you can still do cursed selected just there so it's no different but Machine Tools is free so I don't know why you wouldn't so back into object mode shift and a and then we're going to bring out Armature and we've got a single bone as our starting point here now this would get very very annoying if we have to keep clicking in and out of this in x-ray mode I mean it's not the end of the world but it's a little bit tedious so the first tip that we want to do is if we come on to our right hand side here we can go down to our object data properties for our Armature it's like this little stick man and if we click in front we can now constantly have the bones in front so we can see them really nice and easily which is very worth doing for this process so what we want to do is we want to have each of these joints each of the balls if I go into edit mode so you've got the one there and one there we want to have those on the pivot Points of our mechanical object so my next pivot point is going to be this cylinder here which allows it to rotate side to side in this direction otherwise we're stuck only being able to move around on one plane so same trick here we need some points where we're going to align to and if I just alt select there and then alt select exactly the same on the other side I can do the same thing shift s to vert and then we've got that there so then I come into my bone tab into edit mode select on the top bits don't just have it generally selected you need to select the top part this ball and then shift and S and then you need to move that to the cursor so we've now got that centered and then we're going to do the same thing for our next bone so all we need to do now is still in edit mode click e to extrude and we're going to move that up now for this one I've actually thought about this in advance and got my origin to actually the center of this face and this face so I actually don't need to fiddle around with this as much so alternates I'm going to move the cursor to the selected which is the origin and then I can come into here edit mode there alternate and then to cursor again and we've got that perfectly set up so I'm just going to continue running through here and making sure that each of these bones is set up to each of them over your pivot Points and for the last one where we've got this sort of mouthful jaw for our Servo arm I'm just going to extrude that out and make sure that's perfectly horizontal and you'll notice that when I sculpted this I actually made sure that the arm goes vertical and then horizontally across from Pivot Point to Pivot Point pretty much which just makes life a lot quicker and easier the next thing we need to do is join each of our points to our bones so we've got each section and I'd already got this sorted out which I'd suggest you do before you do the rigging process so you've got our bottom section here middle there and then next one there next one and then uh Jewel now you'll notice I've kept this jaw separately but I have parented that to this upper jaw which allows me to move it by itself but for the rigging it will just stay in relation to this now at this point I'd really suggest that you name your bones so what we're going to do is tab into edit mode and then we can click on each bone and press f2 and we can name these so I'm going to call these bone one bone two and so on and the final thing that's worth mentioning is that these bones do have a definitive shape to them you'll notice that we've got this octahedral and you've got the wider section and then a thinner section that's here and this wider section this bit here needs to be towards the I'm going to use the phrase body of whatever you're rigging and then the smaller section needs to go towards the tip of your extremity so if you think this is being an arm like a human arm this here or the minor point would be flowing towards the hand if you don't do that when you rig this up it's going to move in a very odd fashion and it's not going to correctly move the points that come later down the line and you'll see what I mean when we start moving this around so to parent everything to the bones is relatively simple you click the object that you want to pair so this bottom section you then shift click on the Armature then press Ctrl and tab to go into pose mode you'll notice in the top left hand corner it now says pose mode and then you shift select on the bone specifically that's part of the Armature which for me then goes blue that you want to inherent this too press Ctrl P for parent and then you click bone because we're parenting it to a bone and then you can just go through and do the latest section so we've now got this one shift select and now that we're in pose mode already we can just go straight to this bone so you'll notice click shift click and then click again and then control and P bone so again I'm just going to do that for each of the bones with each of the parts of the model and once you've done that you've got this set up so as long as you're in pose mode notice pose mode at the Top If you're not in pose mode you can just be in object mode and if you click on the rig you come up here and then pose mode or control and tab and then at this point if I let's say rotate this one it rotates everything that comes later down the series of Bones and this is what I meant about having the bones in the right direction otherwise this won't work so let's undo those now if you don't want to do any inverse kinematic rigging if you just want to keep it like this I don't know why you would because inverse kinematics is really cool and it takes no time I'll show you that in a second you can constrain your bones here for example we're going to talk about constraining this in a second but it's different for an inverse kinematic rig and the problem is if I came here and let's say rotate it you'll notice this rotates it in a way that it shouldn't be able to rotate we don't want that so if you just click on a bone you can come down to here where it says bone constraint properties and constraint and you can limit the amount it rotates for example so here we'd have limit rotation and you can limit what axis it's going to rotate in now if you do choose to do this which I'm not going to really talk you through it's relatively self-explanatory and once we look at the inverse kinematics you'll see exactly what we're doing because it does it in a similar way but if you do do this then notice this limits you on the X Y and Z but it is for the global X Y and Z not for the individual bone whereas the inverse kinematics limits the rotation based on the bone itself so that it doesn't get confused I'm going to undo that because we don't want that going on for the inverse kinematics so at the moment we've got our rigging we can move things around as we want so let's get on with the inverse kinematics the way inverse can matics works is that it's going to set one bone that is going to control everything else effectively it's like a pointer and this arm is going to go and try and grab that point now for this it's very important that we don't just make another bone as part of this Armature if we just brought in another bone here by extruding as we did all the rest it won't work what we need to do instead is shift an S move our cursor to that end point and then we want to control it a and bring in another bone you'll notice it doesn't give us an option there it automatically brings in a bone and then I'm going to select on that and S to scale it up so it's a bit bigger and easier to see and that's going to be our inverse kinematic bone so I'm going to select that bone F2 and I'm just going to call this ik bone then we need to select our Armature Tab and this is important you don't go to edit mode you go into pose mode and then we're going to select our ik bone shift select the bone that is furthest down our rig so the one that's furthest towards the extremity press shift and I and then it says add ik and click to active bone and what that's going to do now is if I select this and move it around it moves my whole rig and at the moment this isn't particularly exciting because we haven't put any constraints on other bits of movement but you can see how that's working so escape to stop that now I want to talk about some bits just to make sure this is really clear so I'm going to click on this bone and if we come down to this side the bottom right hand side you'll notice that we've got this constraint and we've got the constraints here for this ik so This inverse kinematics you can do this by selecting it as a bone constraint go to inverse kinematics and set this all up by clicking on the Armature then clicking on the bone that's going to be the Target is just much quicker the way that we just did it but importantly it's got this bit that says chain length now chain length tells blender how many bones to go down in terms of posing so for example we've got one bone there two bones there three there four there and then five there now as long as this is set to zero it will do this for the entirety of the rig and we can see that here if I move that around everything's being moved effectively zero means everything but if we had several mechanical arms not just this one this means that this could start impacting other sections of the Armature that this is connected to so you don't want that to happen so if you've got any other armatures connected what you want to do is set this chain length for example this would be two five and you can see this yellow line that helpfully tells you how far you're going so two is just up to here three is up to there and you'll notice if when three I do this and start G is only affecting those so it's a really quick way of limiting the movement if you want to we're going to come back here and go all the way to five so that we've got that or because I've got nothing else we could set it to zero I'm gonna set it to five because this file is going to be up for download on the patreon page so if you want to grab it you can do and I want this to be rigged in a way that if someone adds this to another object then you don't have any problems so I'm changing that to five so that's us with our inverse kinematics sorted and as long as we're in pose mode we can move this around and you'll notice it can be that the bone goes too far and the arm will stretch out to try and grab it but we have a problem this looks great while I'm doing this here but what doesn't look so good is if I come off of my x-axis View and start moving it around you can see this starts doing some really weird turns for example you'll notice look this has gone off center there this is just turning in a way that doesn't seem to make sense and you've got this which is rotated round in a way that we don't want it to because well I want this to be joined to let's say a backpack and that shouldn't be able to move that way so we're going to undo that we're going to look at how we can make it so that this doesn't pose in a way that should be physically impossible for a machine now we do this on a bone by bone basis and again in pose mode and this is where this gets a little bit strange normally if we want to affect the constraints of a bone we do this here in the bone constraints however when you're doing this for inverse kinematics which are affecting the whole of the rig you actually come into the bone properties section I don't know why who knows and here you've got the option to lock certain axes so you can see that if I just expand this out here now these axes instead of earlier when I was talking to you about the constraints which are done on a world basis these are actually done locally for the bone which means that you are going to need to know which direction the axes are for the bone and that's quite easy to do if I come back to my object data properties and I can click this axis button you now notice that we've got all of the axes and that's even easier to see in x-ray mode where we've got y x and z and if we come back here what I can do is work out which directions I want these to be fixed on so I want this to rotate only in this direction so effectively looking from the x-axis so what I need to do is lock the Y and the Z and now that will only rotate as if it was from this Viewpoint then for our next bone up which has got this section which is going to allow it to rotate this way I actually want this to be able to rotate only on the Y so I'm going to click on my second bone and I'm going to lock everything other than the Y now all of these other ones so bone three two and one I want these also only to be able to rotate on the x-axis so that's really quick to set up if I just quickly get rid of those annotations you'll see now that what I can do is I can press G to start moving this around and you'll notice oh no I just did that one wrong that was smooth let's go back to this bone and I've got that so that it's rotating on the Y because I was in y view this is where we don't want to cause these problems so I looked in y view but it's not the Y that we want it locked on we actually want it locked on the Zed because is we need to use the bone axes not the world one so it's really important we get that right so let's try that again so G and you'll notice now this is rotating the way we want it to and we can have this going grabbing whatever we're trying to get it to grab so again we can have it stretch and we get this nice rotation down there which is the way that we want it to go now the final thing that we want to sort out is well at the moment this is all well and good but it is causing me some problems in the if I go here instead of rotating the head it's just got this arm going into the other arm in a way that it shouldn't be able to so we can see that here it's gone far too far I have actually set this up so that you've got these bits indented so you've got a certain amount of movement that should be allowed but this is going too far so this is again another easy thing to solve and it's all done in this section where we're controlling our inverse kinematics so if I click on this bone here it says our X and Y is locked and and that means and if I just undo the Y you'll notice that the limit option comes back for the Y we get rid of the Y and now it's only being able to allow us to limit the X that's what we want to do we want to limit this rotation on the x-axis so if I click that you'll notice we get this massive red circle showing where it is on the x-axis and you can fiddle around with this and you'll notice it reduces the circle so you can see that over here now we want to actually reduce this one this way so if I bring this back you'll notice as soon as it gets to this ball it starts forcing it back and it won't allow it to go any further so I can now come over here and I can have a look how far should I allow that to go in fact there is probably about right let's try and move this a little bit more so we can see exactly where we're going now at the moment that bit is going into this so we don't want it going quite that far so let's bring that out to about there and then we can have a look in the other direction so I can G and swing this all the way around and we don't want it going that far so I can come back and then start working on the minimum and that's going to force that so that it doesn't cause us a problem there so I want that to go to a maximum of there so this circle is really really nice in a way of showing this I think it's a very visually appealing way of fixing this now if at any point we want to move this back to where it was if we just click on the ik bone and press alt G that's going to set it back to its original position so we don't need to worry about it being in a permanently wrong pose and we can just start working on each of these and how far we want it to rotate so I've just completed that with the other bones off camera just to save a little bit of time at this point what we can do and you'll notice each time you click or if you press a you can see each of those all together which is really nice and what we can do is just come in here press h to hide those bones so we only have the ik bone and then we can just G to pose that around as much as we want and then we can just move that around and everything is posable so that's how you set up an inverse kinematic rig to be able to move a mechanical arm if you found that useful please do click the like button and subscribe and consider having a look at that patreon if you do want to check out the next bit which is going to look at how to add this reading to these pistons and to this cable have a great day guys
Info
Channel: Artisans of Vaul
Views: 10,002
Rating: undefined out of 5
Keywords: 3d design, rig, IK, machine, arm, armature, guide, how to, walkthrough, modelling, animation, 40k, servo, modeling
Id: HjGOeg2PO8Q
Channel Id: undefined
Length: 18min 41sec (1121 seconds)
Published: Mon Feb 27 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.