Control Rig #5: The Reverse Foot | Unreal Engine Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] all right everybody welcome back to another Asad Dev Unreal Engine tutorial we are in our control rig series and today we are going to be talking about what is commonly referred to as the reverse foot my name is Kevin and I am going to be your guide through this little adventure and one of the reasons that we're setting this up and we're going to go over this is it's part of the broader goal of giving you all the little bits and pieces that you need in order to create a nice clean simple rig that you can animate with so with that the reverse foot is something that's probably best Illustrated through example so let's hop into unreal and take a quick look all right so here we are in Unreal Engine and what we have is we're working from this is what we're going to be building today and we're working from the rig that we've been setting up so far where we have ik legs but in this particular case we have one foot that is set up as a reverse foot and we have one foot to illustrate the problem of why we we need it so let's start with what we have if we take our foot and we move it around if we want to rotate and roll our leg off of the foot what we need to do is we need to let's say we pose our leg and actually I'm going to bring down my body just a little bit to give me some Bend in the knees to work with all right so if I want to hose this leg so that it looks like I'm pushing off my toe what I'm going to have to do is I'm going to have to rot rotate this in place and then I'm going to have to grab this ball control and then I'm going to have to rotate it and then I'm going to have to counter that a little bit to finally get a pose that is more intuitive into the way the physics of an actual foot works right you don't think about positioning your ankle and then putting the weight on the ball of your foot your foot is already on the ground the body mechanics of it works where the weight is already there and you just basically rotate up onto the ball of your foot and then eventually off your toe depending on whether you're doing a run or a walk so posing this right leg is the reason why we want a solution to make this more intuitive so let me show you how much easier this is with the reverse foot so here's what we're going to do we are going to take we are going to pick our reverse foot ball control we're going to turn on and rotate and now we're going to Pivot up onto the ball of our foot and we're going to do the same thing with the toe when we want to roll off our toe so it's that simple if we want to we can do the same thing with the heal so what we're going to do is we're going to take our heal control and we want to heat back up on the uh Rock back onto the heel so this is particularly useful for animators when we want to do something like um passing positions actually it turns out we can actually animate that as well uh let's move this forward a little bit grab our reverse heel rotate this back and this is particularly good in order to be able to create some of these in animation what commonly referred to as the contact positions as well as the passing positions and the taking in the weight position where we're actually rolling up onto the ball of our foot so this is what we're building today and we are going to do it using and starting from our basic ik setup so rather than rebuilding everything every time uh to save time we want to focus completely on the reverse foot and that's what we're going to do today so let's talk a little bit about how a uh reverse Foot Works okay so what I've done here is I've popped open Maya to help us visualize exactly what we're building because what we need to do is we need to build a new hierarchy and this is why this is called the reverse foot so let's hide our character skin here and what we've got is we've got a basic we've got our basic Manny skeleton with an ik uh handle in it and what we want to do is we want to be able to control the current foot by using an alternate hierarchy and what does that alternate hierarchy look like well this hierarchy if you look at it let's just delete our ik handle here this hierarchy looks like where we have an upper leg a knee and a foot and then in our foot we have in our foot we have the foot the ball and then there's an implied toe and an implied heel here often times you don't see these joints because they're frequently left out in order to save bone count especially uh from the the older days but the general idea is there would be a toe and a heel here and what we want to do is we want to create and the problem is if we rotate this joint what happens is the ball moves with it makes sense that's the way forward kinematics work the reason that we want to make a reverse foot that starts at the heel then goes to the toe then goes to the ball then goes to the ankle is the difference in the order of rotation so by having this heel here if I rotate the reverse ball look at what happens as I rotate this the heel is going to or the ankle is going to get lifted up by wherever I put the ball and if the ball follows here then it's going to automatically counter animate so what we are going to be doing right now is we are going to to be building this hierarchy that goes from Heel To Toe to ball to ankle it's why it's called the reverse foot because it basically is the reverse of the traditional hierarchy so let's get rid of Maya and give this a shot that way you at least know what controls I'm building and why so we're going to be working with the left foot I am going to go ahead and I am going to add on let's start with three controls all right so we need new control I am going to to call this new control the left heal remember we're going to go heal and then we're going to go I'm going to call these reverse so that it's clear which ones are which and let me go ahead and uh update my size of my fonts so you all can see this a little bit better there we go all right so here we are we've got our our left heel this is going to be a reverse heal I'm going to duplicate that I'm going to call this one our ball reverse and then I need our uh actually we need our toe it doesn't the order doesn't matter yet cuz I haven't started parent things so we need our toe our tow reverse and then we are going to need a place folder for the heel but I'm going to get uh I'm going for the foot which I'm going to get to in a second so remember the reverse order order is Heel To Toe so I'm going to parent my toe to my heel to ball and then finally we're going to go to foot so we have two options we could use the foot as a control or we could use it as a null I think I am going to create it as a null so let's create a new null here and this is going to be my left heel uh actually we're going to call this the left foot reverse so we know which one is which all right so now that we have our hierarchy none of it is in place we need to line everything up so one of the things I want to make sure of is I want to make sure that we don't have any initial settings in our transforms because it's going to be important that these these all settle now what we need to do is to position these we want to go ahead and place them in our construction script so let's take our heel and talk about our first problem if we want to set the position position of this heal control how are we going to choose where that is well what we're going to do because remember we don't actually have and I accidentally have one in here we don't actually have in our hierarchy if you look at our joints we have our foot and we have our ball we don't actually have a toe position or a heel position so much like we did with pole VOR what I'm going to do is I'm going to go ahead and I'm going to add in a heal ref so to do that let's just go ahead and create a new null that we're going to put off of in the case of the heel we're going to parent this to the foot so let's create a new null I'm going to call this the heel not the heel ref and then off the ball I'm going to create a a new null I'm going to call this the tow ref now we could do this with just using transforms in placement but I like to see it visually and I think it will be easier for you all to see if we do this visually as well so we're going to call this the toe tow ref now all we need to do is we need to place these my heel interestingly enough is uh it's actually magically in place and that is because I had actually done this prior so let's just get rid of it so you can see what it is let's delete that so our heel is currently zeroed out and so is our ball ref so what we need to do is let's take our heal ref and let's get it to be approximately where we want the heal Pivot Point to be this is the pivot point so if we move this down in X you'll see that it's kind of moving into place and we'll move it back and let's just say that that is a relatively good pivot point for the heel Maybe a little bit a little bit further forward let's call this five we'll go minus 10 we're going to go even minus 10 oh and I believe this should be minus 5 yeah we're going to go an even minus 10 and minus 5 that's going to be our heel position and so what we need to do is in our construction script I'm just going to set that as well so let's just take our heel ref and we will set it and we're going to set the initial and the value we said in Translation was going to be - 10 - 5 and zero let's connect this in and we need to make sure that our actual heal ref doesn't have any initial on it let's get all of this reset okay compile that all right so it looks like our positioning is slightly off and I think we need to go down a little bit more so let's go down [Music] to oh that's because we're doing this in uh Global space let's switch this to local space okay so local space is better all right so now our heel reference is in position we need to do the same thing with our toe reference so let's figure out what that should be I'm just going to come over here and it's a little bit down that's fine but it's mostly going to be forward and what once again what we're doing here sorry the uh viewport is so sensitive we're we're kind of just putting this at a point that makes sense for our toe to Pivot off the ground when we go for that contact position as an animator so I think that looks pretty good let's call this 8 and it looks like maybe one we'll call it 8 and one so we're going to do the same thing we're going to set the initial null and in this case case we're going to be setting the tow ref so under item let's change this to tow ref okay let's compile that now we also need to make sure our tow ref if we just zero all of this out I accidentally unlicked to ref transform current just reset all this this compile okay now let's double check in our local space because this is remember we had said that this would be seven we copied this this should be seven and we had said that this would be one all right make sure everything else is zero all right so what we've given ourselves now is we've given ourselves a position as a reference point to use for the heel and the toe that's all this did we could have just set it manually but it's again once again it's easier to visualize now that we have those what we can do is we can start actually placing our controls so where does our heal control go well let's set the control position and we're going to set it based on our heel reference so let's go get uh let me collapse this down and make this a little bit easier to find so let's get our heel reference we'll get this null and we're going to feed this into our transform value for our uh for our heal our reverse heel and we're going to make sure it's in global space and let's go go ahead and compile and you'll see that that pops right down there which is great now here's the thing that I want to do I'm going to make this control a little bit smaller so it's a little bit easier to visualize okay and I'm also going to change the color slightly so that that that we can see that okay so that's going to be the heel now we need to move move the toe into place so let's set our toe control position and that is going to go where our toe reference is and our toe reference we have as this null here so let's get that and we'll feed this in want to make sure we check initial again and our toe should move up to the toe point which is great and I'm going to make the same change to our toe actually let's just go ahead and do all of these right now we will change all of these to this little kind of a lighter red and we'll change our scale down so they're all a little bit more the same size and it's clear which ones are the reverse controls and which one is the forward controls for example okay so we now have our toe in position now let's go ahead and set our ball position and our ball position as you would expect is going to go where our the ball is so we're going to set the control to the ball let's get the bone we're going to use this as our transform make sure we check initial here and fill this up okay so it looks like our [Music] ball left ball reference control it's there but it's very difficult to see so I'm actually going to move move this up using the shape transform so that we can see it a little bit better and it's clear the the the pivot is in the exact right place but let's just move up the shape only so that it's a little bit above the foot um let's go back here scale this down slightly okay so that way we can pick this control now we have one more that we need to place and that is this null which references the original foot position position so let's go ahead and do that so let's take this null and we're going to set its position we're going to set its position to the foot control so here we go we're getting our foot and we're going to set our n position initial value compile now the null is difficult to see that it's in the right place but we should be set now in general if we by the way if we wanted to see that something that I'll I'll sometimes do is I'll just add a control to it just a new control and that will quickly pop a visual in so I can see that it is actually position where the foot is and then I'll just delete it okay so now that we have our hierarchy defined when we let's compile and save this just so that we have it just in case we get the crash if we you'll notice that if we move this we don't see anything because our null is not there but if we rotate our toe you'll see my ball rotates and if we rotate the heel you'll see that all of them rotate okay now all we need to do is connect this up and so what we want to do is we want the ik to follow this left foot reverse position now instead of the foot control right now it's following this foot control so if we move the foot control you'll notice that my foot my leg the ik still works but it does not pay P attention to the reverse foot in all the uh all the animation features that we want because right now it's still falling the foot and not our newly created end of hierarchy which is this left foot reverse so down here this is pretty straightforward what we're going to do is for our left foot rather than following the foot control let's change this to a null and let's change this to our left foot reverse all right so visually there's no change our foot still animates correctly which is great but now because we've defined this reverse hierarchy I now have the controls where if I want to rotate the character up onto the ball of its foot what I can do is I can pick this reverse ball control and now when I rotate you'll notice that my character's heel lifts off the ground right same thing if I want to roll off the toe which is awesome and I can tweak the positions if I want to same thing from the heel now I'm going to actually for ease I'm going to take this heel and I'm going to move it up much like we did with the ball to make this a little bit more selectable and easier to grab okay so now I can grab that a little bit easier so let's compile and save that now we're almost done we're almost done if you notice our foot is working exactly the way we want it to the only problem is we are not getting the counter animation of the ball of the of the we're not getting that compression we're not getting the taking of the weight which is basically the floor stopping the toe from going through it so how do we do that all right we need one more you can use a control or or you can use another null node in this case I'm actually going to use a null node but we're going to do is we're going to create another node that we are going to put in that we can use as a reference for the original rotation of this ball so let's go ahead and do that and we are going to parent it to our toe in this case so let's go new null and I'm actually going to call this one the left ball reverse and what we need to do is we need to set its value up here so let's set the the left ball reverse to be the left ball of our foot so let's get this we will set its position Rotation by default which is great if once again if we want to see that that's oh we need to set initial here if we want to see that that's actually in place just to double check ourselves if we WR click and add a new control it should show up right on the ball great so now I know that this ball reverse is in the right place all right so now all we are going to do is we are going to add in one more we're going to use something called a constraint we haven't talked about constraints yet but they are exactly like they sound like if I would like an object to follow another object I can create a constraint a relationship between the two of them and there are many different kinds of constraints there are constraints in Translation so if I I have one object and I want another object to follow it I can constrain the second to the first and they would follow each other around without doing any parenting so they can be separate in hierarchy but they would follow in Translation so we can have translation constraints we can have rotation constraints we can have all kinds of different constraints we'll go into more details about specific constraints and what they are in another video but for now just understand a rotation constraint is I am constraining the rotation of one object to another and in this case what I want to do is I want to constrain the rotation of the ball joint to our newly created reverse ball null so that it will effectively counter rotate so what does that look like so let's create down here in our graph we're going to drag off of here and I'm going to create our first rotation constraint and what we are going to constrain is the ball the left ball and we are going to add in the parent and the item that we have here for our parent is not going to be a bone it is going to be a null and the null that we're going to use is going to be the left ball reverse all right when we do this we should see no change because what we're doing is we are it's all going to be relative to where it was initially when it started that's what this maintain offset does so we should not see any change in our joints no snapping no popping nothing and now if we rotate our character's ball you'll notice that my heel lifs but look at what's happening our toe is counter animating why is that because this reverse ball is parented to the toe it's not not rotating when we rotate this control we're not rotating the ball reverse null we're rotating the control so this stays behind in the original rotation of the ball and then what happens is the joint is now rotationally constrained to follow it so it's not moving so it looks like it's counter animating for us but in now in reality all that's happening is the ball is actually constrain the null and if we take the null if we were to take and rotate the null or convert the null to a control we can control we could even put offsets on it for example but the overall point here is now that we've set up this constraint the ball is actually counter animating for us and we can roll up onto our toe and now we can also roll off of our toe if we want to get to that straight position we can even kind of rotate backwards to get some nice drag Etc but overall all effectively what we have set up now is a more intuitive way for a character animator to animate the foot so it's that easy that wraps up the creation of a reverse foot it is called a reverse foot because it is actually an exact duplicate of the foot but in reverse order and by doing so and leveraging the parent child relationship we are able to to create the illusion that we have uh the the weight and give the animator the control so that it feels much more intuitive to to convey that illusion of weight on the ball and we did that simply with basically creating three or four new nodes plus one rotational constraint most of this was just getting everything into position and parented correctly so it's a very simple setup that allows animators to have the control that they would like as always if you like what we're doing here help us out spread the word let people know what we're doing don't forget check out the Discord and the patreon and also check out our live section a huge amount of our tutorials and training are in the live section we try to do those each week my name is Kevin thanks for checking it out see you all on the next [Music] one
Info
Channel: Ask A Dev
Views: 2,277
Rating: undefined out of 5
Keywords:
Id: LEJM8xLZ5kc
Channel Id: undefined
Length: 25min 21sec (1521 seconds)
Published: Sun Mar 03 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.