Control Rig #1: Intro & Your First Controls | 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 training tutorial Series this series is all about control rig and why it's awesome but in order to explain why it's awesome we kind of need to have at least a foundational understanding of what it is and what we use it for so before we kick off a series where we're going to be talking about fki i k forward sols reverse solves how to create controls quadraped legs multi- select space switching all the things that are rigging related there's a bunch of you that probably don't even know what all that stuff is and so let's set a foundation let's talk a little bit about the use cases for control rig why we want to use it and why it's awesome so use case number one we want to create animations for our game now a lot of times we do that in a separate third party app like Maya blender Max whatever it happens to be but we can actually do that in unreal we've actually covered this on a couple other in our live tutorial series but we're doing it specifically here so we can break it down and hopefully this will be an all-in-one Place compendium for control rig reference but point is we want to create animations so in order to create animations we need a way to manipulate the bones or the skeleton of our character we could just go in and animate each individual joint individually but that would be a surreal nightmare of keeping track of all the controls and everything that go with it so wouldn't it be cool if we could provide our animators or the people who are creating our animations a succinct and easyto use marionette puppet that controls our skeleton that is one aspect that we are going to be talking about with control rig it is a way way for us to create the Marinette puppet for animators to use in order to create animations in Unreal Engine we can also use that same puppet once it's created to do things like edit animations in Unreal Engine so that's one really good use case you want to do animations and Unreal Engine or edit and make tweaks to animations and Unreal Engine now a second use case that is also equally as powerful is we want to do runtime realtime change es to our skeleton what do I mean by that imagine that you have an animation playing on your character and your character is standing on uneven ground in order to accommodate for the uneven ground what you want to do is you want to take the foot and move it down slightly or up slightly depending on what the terrain is like well we can use control rig to do that and what we would do there is we would take our animation then after the animation plays we would use control rig to effectively move the feet the entire leg up and down using something called inverse kinematics so those are two really good compelling reasons why we like control rig why it's awesome and now we're going to kick off a series that breaks this down piece by piece controls FK ik all those different things but before we do that as part of today's intro we're actually going to be talking a little bit about creating your first control rig the parts of the actual UI what they mean where they go and then we'll start the individual pieces so let's hop in to Unreal and take a quick look so here we are in Unreal Engine and what we have is we have a skeletal mesh that I've created this is a very simple skeletal mesh when I open this up you will see it is actually just a Vive controller that has a single joint in it and today's goal is to create a control that will move this if we want to so first things first what we have is we have a skeleton what we need is a control hierarchy to drive it and then we need the ability to combine the two so in order to create your first control rig what you do is you right click on any skeletal mesh actor and if you right click under create you'll notice there's a control rig option that is going to automatically create a control rig for us I'm actually going to rename this to be CR control rig underbar VI Scout uh we'll call it we don't need there we go so we're going to call this CR Vive preol mesh for example so that's control rig Etc now when we open up our control R interface there are a couple of things that are important to understand about how this is laid out so so we have our viewport in the top left this is basically going to show us the current state of our rig we have our rig hierarchy which for now in this particular case is just a root joint but just as an example let's go ahead and show you a more complete control rig so that you can see one and we're going to take a look at the default control rig for the mannequin body that comes with the third person uh character project so let's open that up just so you can see what a more complete hierarchy looks like and you will notice when we look at this this shows us what a control rig might look like when it's completed what we have in here is we have a whole series of controls as shown by the red yellow orange controls these are the controls that are the marionette puppet controls that we're going to be building as part of this series down here on the left this is our rig hierarchy it's a much more complete hierarchy because it's a full character ours is much simpler because we have a single joint for today but we are going to be working with complex characters so that we can create ik setups and all those kinds of things Etc over here on the right you can see how crazy this can get there are multiple things going on this is basically our rig graph there's a few major parts to this all right the first part is the forward solve basically this is what happens this is the solve that happens when we move one of our controls it is going to forward solve to determine where the arm should be in this particular case so when I move that control or for example the body control it is solving all of the positioning so that my knees Bend or whatever else I've built as part of my control rig so this all just works that's the forward solve okay we also have in a completed in a more complete graph we have we also have the construction event this is for us to set up all of the uh initial state of our controls and character before the control rig starts so for example if we want to set the default position of a control we might do it in Con in the construction script that way it's already in place where it should be when the forward solve actually happens okay that's our construction event and then finally we have our backward solve it's going to be a little while until we talk about the backward solve the backward solve is there for us to be able to take any animation and backward solve basically recompile it onto our character's control rig so for example what do I mean by that what I mean is forward solve we animating by hand we are telling the joints where we want them to go a backward solve would be in the case of you have an animation that's already done and you want to edit it so what we would do is we would backwards solve from the skeleton to get all that information onto our control rig onto that puppet that we've built so that we can then make changes to it so that's what the backward solve section is for then as usual in a lot of our interfaces Etc we have our details and attributes over here on the right so that's a quick breakdown of each of the parts of the control rig hierarchy and what we are going to do today very quickly as we we going to create our first set of controls so how do we create a control well there are lots of ways to create controls in general you can just rightclick and choose new control and that will create one we're going to be talking about different methods of doing this uh as we move forward because depending on the hierarchy unreal has tools that will help you create controls that are already in place but overall big Point here is we've created a new control now I would like to rename this control so I'm going to call this the actually no before I rename this let me show you one other way to create a control if I select a joint and I right click on this I can say new add controls for selected when I do that it will automatically create a control for me one of the cool things about it is it's automatically going to name it the root underbar control so this control is is pream to potentially control the root which is potentially helpful so but because there are other things that we want to be able to do with this character we're going to make a couple changes to this hierarchy so I'm going to right click I'm going to create a new control I'm going to control I'm going to call this the layout control and this is just going to be here so that I can um so that I can control everything so if I once I have a post was done if I need to reposition the whole thing in place without breaking anything I could use the layout control to do that but let's make a couple changes here because we can't see our layout control and this is where we get into understanding the difference between the control and the visual for the control right now the visual for the control the shape it's often called is a giant red sphere what I'm going to do is I'm going to change this shape so oh when we pick our control over here on the right you'll notice that we have the transform and then we have the shape the shape is where you edit the Aesthetics the visuals of the control not the actual physical attributes so underneath shape properties I am going to change this you'll see we have a really nice drop down of all kinds of predetermined shapes you can even create your own if you want to but that will be another class for now let's just go with circle th oh actually you know what let's do let's do hexagon then okay now you can kind of see it in here slightly but it's a little bit small and the point of this is to control the entire character it's the basically going to be the layout for the whole character so I'm going to make this bigger now you need to make sure that you're working in the shape section because what we are what we want to be doing is we want to be updating the overall shape of the the the actual visual of the control not the actual transform so over here under shape I'm going to lock my scale and I'm just going to Triple this so now we have a control that is roughly you know three times the size I'm actually going to make this a little bigger cuz I want it to be the whole size of the character for example okay so we have our layout control now now I'm going to change the color of it as well all we do to change the color is we click on the color and we pick a new color I like I like to follow a color Paradigm and you can actually see it here that is very similar to this the right side is red all of you audio files out there will love this writing writing right is red so right side of the rig is red it makes sense they both start with r depending on the language and then the left side is blue it's very typical for most animation Rings let's talk a little bit about why we do this okay the reason we do this is we want it remember the goal of this is to make it easy for the animator to control the puppet that we create well in addition to making the controls easy to select and intui to understand one of the things that we want to do is we want to make it clear what's being manipulated in this particular case because the right side is red I know that if I pick this circle I'm definitely picking the right arm now from this pose it's very easy to see that I'm picking the right arm but if my character was like this it's a little harder to see which one is red or blue or which side I'm working with am I on the left side or the right side so depending on your poses it can be very beneficial to help the animator out and let them know through Visual cues that right side is red and whatever you pick for your convention I would recommend you to stick with it this is a very industry standard accepted convention right is red left is blue a lot of times you'll see yellow down the middle or some variation of that so let's go back to ours that's why we made that yellow I want to show you a quick little tip when we created our color what we can do is we can actually drag this color here let me let me bring this over here so you can see it we can actually when we pick our color once we have that in place what we can do we'll just make this perfectly yellow Ah that's a no I want it a little more towards orange okay what we can do is we can drag this up here and save this that's awesome because now what we can do is anytime I come back here I can make sure all of my Center controls are the exact same color of yellow there's not there are no changes all right so we have our our layout control now let's take our root control now what we want to do with our root control is let's also go ahead and adjust this I'm going to change this to be a thin circle and let's go ahead and make it we'll make it yellow too and we can do that simply by uh clicking on yellow that we've already created for example and we can scale this in place place if we set our if we lock our scale when we adjust one and adjust all of them okay so now we have two controls it's very clear when I look at this control rig this Marinette puppet that we've created that these are two different controls and if I use the same visual language throughout every rig I create any animator that picks that up will understand that generally speaking if Kevin made a rig then the hexagon is the layout and the roof might be a circle for example okay so now that we have our controls we need to make some hierarchy adjustments because right now if we move our layout you'll notice that the root control does not move with it okay and and notice I'm saying control now also notice if I move this control off into space and I press compile it snaps back to where it started all right that's because this is a temporary setup where when we compile it's putting the rig back in the state that it's default state so what we want is we want the root control to move with the layout control so let's go ahead and parent that in there so the way I did that was I clicked the root control and I parented it to the layout control so now that I have that in place what I can do is I can move my layout control and my root control will go with it I can compile to get it back into place so we have just successfully created two new controls that have their own independent hierarchy and the goal of this independent hierarchy is to then drive the joint hierarchy of our actual character so that's going to be our next step and keep in mind we can do lots of crazy stuff with our control hierarchy we can do things like add in pivots and stuff like that we'll do that here in a minute but what we're going to do is we are going to basically now connect our newly created control rig to our character and then wrap up this video so we created two new uh we' created our controls they look pretty now let's go ahead and connect this in what I'm going to do is I'm going to take the root and what we need to do in our minds is think about it we just need to set the transform of the root so let's just drag this in here and we are going to set our transform all right when we do this this what are we going to set it to we are going to set it to the position of our root control so let's drag this out here and let's get the control now this gets us the current transform of any control we specify you can see here we can change it and this sets the transform of a bone all we need to do is connect these two together so for a forward solve because remember the forward solve is the one that we're going to use for animation what we're going to do is we're going to we can connect this into our execute and what we want to do is we want to connect the transform from our control to the transform for our bone all right when we compile this nothing should move because our controls transform is at the same position as our joints transform our bone transform so nothing moves this is the new default state but now when we move our our layout control notice our character goes with it we are now actually physically moving our character in space and we can even offset it using the root control now there's there's a couple things that are important to understand as a result of this very simple setup generally speaking it is important to understand the parent child relationship so our layout our our root control this circle is parented to our layout control where wherever our layout control goes our root control is going to travel with it however because our root control is a child we can move it away from our layout but remember that relationship still exists so if I move the layout they are both going to move together but it's going to maintain the offset that we created by animating this control off to a new position in space so this is something that is is important and worth understanding because this parent child relation one it can help you build out your control structure two we are actually going to use that we're going to leverage that understanding to create the ability for our characters to be able to be or to be able to basically dynamically change the parent of things using space switching and stuff like that so it's just important to understand that that's how that works so let's compile that you'll notice when I compile I lose all my animation everything goes back to the default state which is currently defined by these controls now if we wanted to change our hierarchy we can so let's go ahead and right click on our layout control and add a new control I'm going to place this control over here on the left side just as a pivot for example why am I doing that well what I want to do that the reason I want to do that is because what I I want to show you that now we can control our root just by simply adding in a new new parent now one thing I want to do you'll notice that if we look at this over here on our right if we look at our transform for this control it actually has values in it if we compile you'll notice that that control moves back to the origin that's because the default state for this control is at 0 0 if I want the default position for this control to be currently this -20 let's just make this a nice clean number -20 what I need to do is I need to tell this control that this is its default transform so if I rightclick I'm going to set the offset transform from the current when I do that that is going to update you'll notice that I now have zeros here okay all of that information got copied into the offset for this transform so when I compile my control stays in place now and if I take and I par oops I got the wrong thing if I take my root control and drag it and parent it to my new control this does a couple things nothing moves because everything is at the zero State I can still move my layout control as before and I can still move my root control as before but now I also have an additional control that I can do various things with it obviously will move the child the child happens to be the root control remember the root control is driving the actual joint the actual bone so the that's what makes it look like our character is moving but even more interesting is now I can do things like I could rotate and when I rotate I can now rotate around this pivot so I can actually create additional pivots for my character to my character or whatever the prop it is I'm doing where maybe I want this character to be able to rotate around this pivot for example but something that might be more beneficial IAL is if we took this oops if we took this uh we're going to have to disconnect this for a second I'm going to compile and disconnect this if we take this and we move this control over into the base you'll notice that the root is traveling with it I'm going to right click and I'm going to reset the transform I'm going to set the offset transform from current I'm going to compile when I do that you'll notice that it actually changed my root control so I want to change this back to be zero so I'm going to go and reset this um but technically it's not really zero we actually need this to be the exact um negative of wherever we put this control so here's an example let's put this control where we want it let's call this uh actually let's zero everything out just to make this easier okay we're going to currently we'll zero this out everything's back at zero let's unparent the root control for a second and let's take our new control move it out here in space so our root control is not moving I'm going to call this -17 cuz it's easy to see and that's going to be basically around the pivot the handle pivot of our character let's go with circle thin just so I can see this and we'll keep it red temporarily even though it's not left or right side we'll just keep it red so we can see it and then let's right click this control and set the offset from the current let's take our root control and let's parent that into our new control now when we do that this is why the parent child relationship is important to understand when we do that you'll notice that it autofilled in the offset it looks like for us okay we could have done the same thing ourselves manually but the point is remember a child is relative to the parent and we use the offset to actually kind of bake in the actual difference so that the controls where we want it to be so if I were to reset this you'll notice that my root control goes back to where it was I don't really want that I'm going to put this back to here and by doing that when I go ahead and compile this now same thing that was a um a little bit of a rabbit hole of helping understand the parent child relationship but this is a a more applicable example we have all the same controls we had before we can move our layout we can move our root control and we can also move now our pivot so I might name this something more appropriate so for example we might call this the root handle pivot control and now as before we can move but we can also rotate and the rotation will be around the actual handle the end point of this actual mesh so we can actually use controls to create offsets and pivots and all kinds of different things and we're going to be using all this information to build out a full character control rig as part of this series so that wraps up a quick intro to control rig what it is why we use it what's awesome about it how to create your first control and how to connect it up to your character we are going to be breaking this down we're going to be digging into more about controls FK which is forward KX inverse KX and all the upcoming videos feel free to check those out also don't forget to check out our live section we do live tutorials every week a lot of people miss the fact that those exist my name's Kevin thanks for checking out this video we'll see you on the next [Music] one
Info
Channel: Ask A Dev
Views: 5,862
Rating: undefined out of 5
Keywords:
Id: hhcpSXJ2zak
Channel Id: undefined
Length: 25min 51sec (1551 seconds)
Published: Sun Feb 11 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.