#RiggingInMaya | Part 13 | IK Limbs

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
the fk limbs are now working so the animator can pose and animate the creature using forward kinematics what we're going to do next is also give them the option to work in ik or inverse kinematics really quick question for you now how would you like to help support the future of this channel and keep these videos free well there are a few options one would be to simply treat me to a coffee at my coffee page as a quick and easy thank you you could also grab something from the ant cgi store or one of my other online stores like cubebrush and gumroad this is where you will also find the course files that go with this course so you can download them and follow along however for as little as 99p a month you could join the ant cgi club there are a few ways you can join you could head over to my patreon or coffee pages or or alternatively simply hit that join button below this video in short the more support i get the more time i can dedicate to creating more high quality content just for you to get more information on how you can help follow the link on the screen or in the description below okay now that's out of the way let's get on with the video first let's sort out these controls so we only see the ones we need so basically we only see the fk controls when working in fk and only the ik ones when animating in ik and if you remember we did a similar thing when we were setting up the spine open the node editor what we need is a main arm control and also the reverse node we created to control the ik and fk blending we can remove these open these so we need the output x attribute here because this reverses the ik fk switch attribute now bring the arm ik control and the upper arm fk control into the node editor 2. move these up here now simply connect the ik fk switch attribute to the upper arm f k controls visibility attribute so those are vanished now and then connect the output x attribute on the reverse node to the visibility attribute on the arm ik control we can now hide the controls we don't need if you remember this was also the same setup we used to control the visibility of the text here okay let's find the ik and fk joints here we go let's hide the fk joints for now so we can focus on the ik ones we now need an ik handle so go to the skeleton menu and then down to create ik handle and open the options just reset this we can leave the default options here the solver we need is the rotate plane solver this will create an ik chain but give you the option of being able to also rotate it which we need so we can control the elbow's position now select the upper arm ik joint and then the hand ik joint an ik handle is then created for us we can move this around and the arm follows so this is how ik works it evaluates the joint's rotations from the hand up to the arm with fk the arm is evaluated the other way so from the upper arm down to the hand hence its name forward kinematics okay let's rename this call it arm left ik handle now parent it to the arm ik control just add it to the selection and press p we can use the control now to move the arm rather than the ik handle rotating doesn't work yet but we will come to that later you see we can move the body now and the hand tries to stay in its original position the problem is we have no easily accessible control over the elbow so let's add that next down here we have these pointer control icons so where is the arm on ah here it is arm pv control the pv just stands for pole vector although you may want to rename these to elbow control just so it's more obvious what they are first let's move it so it matches the elbows position and orientation let's switch to wireframe so we can see it so this is pointing or it will point towards the elbow with that selected also select the ik handle and go to constrain pole vector to create a pole vector constraint what this will do is use the plane created along the arm so this triangle here and try to keep the elbow aiming at the control if we move the arm control now you see the arm is flipping because the elbow control is too close if we move it behind the arm instead you see the arm twisting to stay pointed towards it not just that though it also gives us more control when it's behind the arm the problem is as we move it the arm twists slightly and this is just down to how the skeleton was built and the positions of the joints the only real way to get around this is to have the arms completely straight when viewed from the front so they're perfectly level but this doesn't always work with the character models or other elements of the rig but it's easy enough to get around so you see the elbow has changed position you can see it clearer if i show the model again ideally we need there to be no movement as the animator switches between the ik and fk arms they should both be in the default position when the rig is in its neutral pose so what do we do well we need to record the movement and then apply that to the control as an offset to correct the movement and move the elbow back into position first create a temporary locator no need to bother renaming it because we're going to delete it soon and use the match transformations tool to move it to the elbow joint let's make this a little bigger and now duplicate it so we have two locators we now need to move these back behind the arm let's open the move options and use the step snap option to move it an exact amount this is just so that we can move all these controls the same distance so set this to relative and we will leave it set to 30 and move these back now parent one of the locators to the elbow ik joint this now follows as the arm moves select the arm pull vector control and move this back now to speed things up we can quickly just match the locator's transforms what we have now is a difference between the locators and this is the distance we need to move the control to correct the offset now you could work out the exact distance between the locators using some of mayer's distance tools but sometimes it's just easier to eyeball it so move the control up until the locators lie in the same place turn off snap okay that looks about right now that's in position we can delete those locators if you want you can delete the poll vector constraint make sure the arm is reset so no rotations are on the elbow and then reapply it but you may find this doesn't make a huge difference so you may not need to reapply the constraint so we can now again use this to control the elbow if we move the arm control the elbow points towards the pole vector control and if i switch between ik and fk you see the arm doesn't move now so we have kept the ik arm in its default pose now that's set up we can clean up the controls so move the arm pv controls attributes values down to the offset parent matrix tab like this we can also do the same with the main arm ik control 2. ok let's fix the wrist now so this needs to match the controls orientation so it stays level no matter what the rest of the body does all we need to do is use an orient constraint so the hand ik joint is constrained to the control so select the control and then the hand ik joint and go to constrain orient you can disable maintain offset because they should both have the same orientations apply that and we have control over the hand now if i move the body the hand maintains its orientation actually it looks like we need to play around with some of the weights here but this is what's good about having a skinned model as you're building the rig you get to spot areas like this as the model is deforming okay so the arm is now set up with ik controls okay let's move down to the leg now if this were a normal biped leg then we would pretty much use the same ik setup that we created for the arm this limb is a little different though because it's made up of three sections instead of two so it's classed as a quadruped limb now there are lots of ways we could tackle this leg and i do cover these in my quadruped limb comparison video so i do recommend you take a look what i'm going to do here is use my personal favorite setup but it may be that one of the other configurations better complements your own rig okay so i've already updated the controls visibility so they change with the attribute just as we did with the arm and the spine so the ik and fk controls show and hide when needed i've also added this extra hock control here which we will be using later to add more functionality to the lower leg and this is simply parented to the foot control okay let's find the main ik and fk joints and hide the fk ones what we need is another set of joints ones which will help to drive the quadruped leg so use ctrl and d to quickly duplicate the thigh ik joint and then delete the toes we just need the four main joints now rename these changing ik to driver okay let's isolate these now what we now need is another ik handle but this time we're going to use a spring solver you can also use a rotate plane solver 2 if you prefer actually let's create one of those first so we can compare so create it from the first joint down to the very last joint if we move the ik handle now you will see that the lower leg compresses more than the upper section so this is okay but it's not perfect let's undo that and now let's create a spring solver you see we now have a much nicer and more predictable compression throughout the whole leg one thing to point out is that the spring solver isn't always available as an option if you don't see it all you need to do is activate it you can do this in the script editor using a simple command ik spring solver what you can also do with a spring solver is adjust the spring angle bias here using the ramp we can adjust how the leg compresses so on a more advanced rig we could wire this up to some controls to give the animator the option to further fine tune the poses now the spring solver is great in some situations but it won't always work with every rig it can be a little temperamental as we will see later let's rename this to driver left ik handle and bring the rest of the rig back we are just going to parent the ik handle to the foot control so select it and press p the driver leg now moves with the control okay now we need to work on the ik leg so isolate it this time we want to rotate plane solver but create this so it goes from the first joint just to the third here rename this to calf left ik handle we're calling it calf simply because it's the same as the joint where the handle position is now create a second ik handle this time we want a single chain solver and create this from the calf to the foot joint call this hock left ik handle we used a rotate plane solver above so we have the option to position the knee just like we did with the elbow with the single chain solver we don't need that option so it's safer to just use that so we now have two handles controlling this ik leg what we now need is for these handles to follow the driver leg so basically what we're going to end up with is the spline ik controls the driver skeleton and then that in turn is going to control the positions of these two ik handles so first parent the calf ik handle to the calf driver joint and then the hock ik handle to the foot driver joint if we bring back the rest of the creature now and move the foot control you see that the leg is now following and we are getting the nice compression along the limb now we could just get this using the spring solver directly on the ik leg but we want to give the animator more control over how the leg can be posed and animated this is why we're using this two skeleton system i'll just test the top of the leg actually while we're here so we need the upper leg to follow as the torso moves looks like the ik leg isn't following the root control so let's update that jump over to the node editor and bring in the leg root control also add the thigh driver joint and the thigh ik joint reposition these all we need to do is connect the leg roots world matrix 0 attribute to each joint's offset parent matrix attribute you will notice that the leg is now twisted but because we are using the offset parent matrix attribute remember we need to zero out the joint transforms that's better now the ik thigh and reset the transforms you will notice that there are still some rotations here these are actually coming from the joint orient attributes but the leg hasn't changed position because it's being controlled by the spring solver now it's important that you also zero these out too and i actually forgot at this stage if you don't zero them out you will end up with problems like this where the leg seems to be rotating in the opposite way now on a side point if you do find that you're having some issues with the leg maybe try switching to a rotate plane solver instead these do tend to be a bit more stable okay let's get back on track now let's fix the foot so it stays level as the leg animates just as we did with the hand select the foot control and then the foot ik joint and simply use an orient constraint so now the foot stays in place planted on the floor which looks a lot more natural and we can control the upper leg too okay now let's add in the hock functionality what we're going to do with this control is use it to reposition the calf ik handle so we can pose the lower leg as you can see simply moving it is causing the foot to move so ideally we need the ik handle to pivot around the foot joint instead this will keep the foot steady and planted on the floor press ctrl g to create a new group we want the group to match the orientation of the hock control so add it to the selection first use match transformations to move the group to the control we now have the correct orientation let's rename the group to hock left control offset we now need to move it to the foot joint so add the joint to the selection and this time just match the transforms so we maintain that orientation there the group's in position now and orientated correctly too and we can rotate from this point now move the group so it's parented to the calf driver joint we now need to remove these rotation values but we can't freeze them as we will lose the orientation so instead just move the values down to the offset parent matrix section like this now the rotations are clean we can connect them using the hock control to drive them next move the calf ik handle into the hook control offset group if we now rotate the group the lower leg moves but the foot stays in position perfect okay we now need to wire up the hot control so it rotates the group head back into the node editor and clear it bring in the hawk control we need its translations and then bring in the hawk control offset group we need the group's rotations what we're going to do is make the translations drive the rotations let's check what axis we need so if i move the hot control along the x-axis we want the group to rotate like this so around the z axis so let's connect translate x to rotate z if we move the control now the lower leg moves but in the opposite direction so we need to invert that value press tab and create a multiply divide node and rename this to hawk left multi what a multiply divide node will do is basically take one value and then multiply or divide it by another simple as that rather than using individual attributes i'm going to connect translate directly to input 1. so all we're doing is grouping all those attributes together so translate x here will be represented as input 1x here this means we need the output x attribute here so connect that to rotate zed we can delete this now so at the moment things look the same but what we can do is change the input to x value to minus 1 instead of 1. so the translation value is now being multiplied by -1 which will invert it and the control now moves the right way what we can also do is use the node to make the leg move closer to the control let's adjust this so it's in the right position so -2 seems about right so remember what it's doing is it's multiplying the hook controls translation value by minus two okay that's better let's look at the other direction so it looks like we need the translate z attribute next okay let's check the group looks like we need it to control the x rotation so we need input 1z here because this represents the translate z attribute and the output of this is output z so connect that to rotate x okay so this time the direction is correct but the leg needs to move more we used -2 earlier so let's try changing input 2z to 2. yeah that works okay good we can move the upper body and the leg follows we can also control the hawk too okay the last step is to add the knee control and this is just the same as we did with the elbow we have our pull vector control here which will be the knee control let's bring back the joints select the control and then the knee joint and use the match transformations tool to snap the control to the joint i'll swap to wireframe so we can see it i'm going to rotate this so the point points at the knee i'll use snap so we get an exact rotation that's better with the control selected add the calf ik handle to the selection and go to constrain pull vector if we move the control out now you see we get the same issue as the elbow where the joints are moving so we need to add in the offset create two new locators and match these to the knee joint let's make them bigger so we can see them and we need to move them out so let's snap them and maybe use 30 again now parent one of the locators to the knee ik joint doesn't matter which as these are just temporary move the control out now to the same place as the locators turn off snapping and move the control until the locators lie in the same space maybe a bit more okay that's close enough let's test it before we delete the locators so there shouldn't be any movement when we switch between ik and fk okay good now delete the locators all we need to do now is clean up the controls so just move all the values down to the transform offset parent matrix tab something that you will be very familiar with doing by now or just use the script that's zeroed out now so is ready to be animated let's just hide the joints and we have control over the knee i can move the foot and the knee stays pointing at the control we can also adjust the hock control to further refine the pose okay so all we need to do now is repeat the process over on the opposite arm and leg so it's time for that point in the video where i pause it and then i come back and everything's magically done okay that's the arms and legs set up with both fk and ik functionality so all the main areas can now be animated and they all move together i also cleaned up the joint orient values on the thigh joints which i forgot to do earlier so the spring solver is behaving now if you remember because i left these values on the joints the thigh was rotating the opposite way whereas now they rotate the right way so what i want to do in the next video is look a bit closer at space swapping so we can dictate what the controls follow again this gives the rig much more flexibility for the animator okay that's another video over thanks for watching right to the end and make sure you also check out some of the other free videos and courses that i have available you can find links to all these on the screen now and in the description below remember to help support future content and keep these videos free visit the ant cgi store or join the ant cgi club alternatively if you would just like to show your appreciation for these videos why not treat me to a coffee at my coffee page again the link is on the screen now and in the description below thanks again for watching this is ant cgi signing off and i will see you on the next one you
Info
Channel: antCGi
Views: 494
Rating: undefined out of 5
Keywords: rigging, maya, autodesk, maya3d, rigging in maya, utility nodes, rig, node editor, nodes, Build Controls, 2019, Spine, Head, Pelvis, Waist, Abdomen, Sternum, Shoulders, gamedev, game art, game development, game rig, 2022, maya 2022, offsetParentMatrix, ik, rotate plane, solver, hock, quadruped, dog, canine, three joint, pole vector, fix movement, hock control, elbow, knee
Id: yls25bV-IZU
Channel Id: undefined
Length: 29min 58sec (1798 seconds)
Published: Wed Dec 08 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.