#RiggingInMaya | Part 3 | Fundamentals | Control Creation & Setup

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
we are now on the third video in these rigging in Mayer series we've covered joints and the various ways you can connect things to those joints so now let's take a deeper look at another important aspect of any rig and that's the controls so why do we need controls in the first place well if we look at our base skeleton here and this is just a basic arm skeleton an animator can come in you know adjust the rotations to pose the arm and add keyframes but then if you want to reset the arm back to the the base position you can just zero out the rotations and that works quite nicely because all the rotations start off at zero doubt values now as we touched upon in an earlier video when you create joints they always have a translate value on them sort of offsetting them from the world route or from the previous joint so if we were to say we wanted to animate and we move this up like so how did the keyframe moved it again say we wanted our character to shrug or we just wanted to adjust the positions of the shoulders so now we've moved that I can't remember what the values were to put it back to its main position if I zero this out it's just going to snap to the parent joint because it's the translation values are an offset from that joint so there you can see we're starting to get problems if I've gone in an animated these and animated the translate values I can't get back to the base pose well not without a bit of jiggling around and a bit of difficulty anyway having a control on top of these joints means that you can have a clean rig with all zeroed out attributes which makes life a much easier for the animators another reason why controls are good is because a lot of the time you're not controlling the base Skype skeleton directly what you would have is you will have assists which works you'll have your control and then you will have a system in between and the system drives the joints now this system could be anything it could be a basic I kfk blending system it could be a more advanced ribbon based rig which and we'll cover this in a future video but this allows you to have a much more flexible rig perhaps you want stretchy limbs so you'll need a system in between the controls and the skeleton as well so you can starting to get the idea of why controls are important so before we go on to making our own custom controls there is a system in Maya where you can actually add controls to anything well when I say outer controls what I mean by that is everything out has what it's called a selection handle so if I select the root of this skeleton and i go to select hierarchy and then i'm going to go to display transform display selection handles here now if you could see you have to zoom in there are these little crosses here and these allow you to select the joints now at the moment they do look very useful because they are in exactly the same position as the joints but you can move these to anywhere you want so I'm just going to go over here to component mode and then I'm gonna make sure handle selection is enabled here so now I can select the handle I can hold down shift and I can select multiple handles and then I can move those out like so go back to object mode and as you can see the handles are now outside the joints so that just makes things a little bit easier to select I mean we're not getting over the issue of these translate values on here I'm just demonstrating that there are ways that you can add in quick selection tools for things and these exist on a lot of nodes in my and not just joints but it means you're not having to select the actual joint itself you can just select these handles but the problem with these is when you get to a view like this you can't tell which selection handle is going to select which joint because they're all the same if we come down to the hand now if I moved all these handles out as well as you can imagine if we're looking from a different angle you can't tell which selection handle is going to affect what so again this is why controls are a lot better because you can create your own custom shapes which are instantly recognizable from any angle so you could have a different shape for the clavicle a different shape for the shoulder and a different shape for the elbow you know and what's more you can make those different colors so you could have the left hand side a different color to the right hand side which just means if you're looking from the side you can instantly see what they are so selection handles do have their place but I think when it comes to rigging I don't find them very useful what I like to do with my rigs is I like to hide the base skeleton just so that the animator can't access it and accidentally break it you know if they're animating a control and they just drag like so so they've selected the control and the joint as well and they move it so you'll end up with the keys on the base skeleton under control and it just breaks things so I like to hide my skeletons and as you can see if I hide the skeleton the control handles go with it even if I go to the menu appear and I go to show and disable joints the handles go with them as well so again they're not very useful if I wanted to hide the skeleton they're going to get hidden as well whereas if I've got a separate layer of controls on top of these I can get rid of the skeleton the animator only has the controls to play with and nothing's going to get broken because I can then lock off or anything that they're not allowed to touch so that's just a brief you know discussion about why we need to use controls and also just showing you how you can use selection handles you know just to make things that are sometimes tricky to select a lot easier to play around with so let's now have a look at just creating a basic control just so we can start working with this ah and one of the most basic things that I normally use is a NURBS circle and you can create one of these just by going to create NURBS primitive circle like so so I'm just going to scale that up and that's it basically that is just a very basic control just going to scale it down a little bit and I'm just going to freeze the transforms which is just going to fix these scalar values we have modified for each transforms there we go delete the history so that is the most basic of controls I mean another option is you can use a locator but I like to use NURBS circles as a starting point because you can edit them and make them into more unique shapes but we will look at that a little bit later on so let's say you have your control so if I hold down V and with my middle mouse button I just snap it to where the shoulder is and we select say we want this to control the shoulder well that's fine because what I could do now is I could just select the control well let's give it a name shoulder underscore ctrl which shot for control and when you are naming your controls it's good to have something like that at the end of the name because then if you are doing a search for something you can just do underscore control and it will give you all the controls so let's keep this clean and I'm going to freezes transforms and I could just go select the show the joint and like I showed you in the previous video constraint and we could choose which constraint we want so we could either just allow the control to adjust the orientations or just use a point constraint so it will to only move with the control but for this I'm just going to use a parent constraint just going to reset the settings and keep maintain offset on well let's just try that apply so see with maintain offset off now even though the values were zero what it is done is it's tried to match the joints orientation with the controls orientation as you can see if I undo that like so so if we see here why it's pointing down the bone whereas in our control y is pointing up so what that's done is it's tried to match that because we've had maintain offset switched off we've tried it's tried to match each of these axes to these ones so if I keep maintaining offset on and click apply so that works much better and what we can do now is we can rotate that and it's controlling the shoulder and we can use the translate and then if we need to reset we can just zero that out on the control and that resets it back to where it should be now the problem we do have with this is because this axis is completely different to this axis you will end up at some point where the where the axes will overlap or they won't align properly because so let me try and think of a way to explain this so because Z is pointing this way we need to rotate around Z with that which will work okay because they're all sort of aligned in the same sort of place but if you can see if I just undo that and I'm just going to affect the Zed axis there if I rotate that down what we would what ideally need to see is on the skeleton just values on the Z as well but as you can see we've ended up with minus 10 here 4 here minus 67 on here so the values are completely different now initially this may not seem like an issue but you will get problems further down the line where you're animating with this and because it's you're using constraint you will get to a point where this value here will be say 360 or 180 and it starts to get confused about which way it should point and you'll end up with a flip now you may have seen this if you've been building rigs before you've added a control and as you're animating suddenly for no apparent reason the shoulder will flip and that is because the axes are misaligned so when you just rotate one value on here all three values are changing here because they're trying to stay sort of a relatively same orientation to the control now I'm not sure if I'm making a bit of any sense here but I think you kind of get the idea the basis of it is we basically want if I just undo all this get rid of that constraint we basically want to be able to rotate that around the z axis its constraint still on there reveal selected let's just get rid of that here we go so basically we just want to be able to rotate that down like so and on our skeleton we just get the rotate set and even there you can see a plus value on the control makes the arm rotate different way so then we're getting conflicts which the constraint is trying to fix but it will get to a point where it flips now the way around this is to basically say it right I know that this orientation is different to the skeleton so why don't we just make sure the control is orientated the same way as a skeleton well yeah that makes sense so a quick way to do this let's turn maintain offset on the parent constrain let's select the skeleton selects the control and click apply so now we have the control orientated and you can see if I switch between the two the axes are identical so I'm going to delete that parent constraint because it was only a temporary one just so that we could get the control matching the shoulder joint now the problem we have now is what we were talking about before we've ended up with rotate values because this control has had to rotate so that it can match the orientation of the skeleton and we could select both of those and rotate said you know and they seemed to work fine but again the problem is we've got these here but yeah we could just freeze the transforms couldn't we modify freeze transforms Oh but yeah freezing the transforms as reset the orientation so that's not going to work because that brings us back to square one so let's just reset that back to where it was so what I always like to do with my controls no matter what controller is I always create group on top of it reset the pivot so they centers to the control itself and then I'll just call it the same but do underscore offset as well so that I know if I do assert quicksearch that is an offset to the control and what we can do now is we can select the offset and select the skeleton nope we need to do it the other way around so we select the skeleton and we slightly offset because we're applying the constraint to the offset now if we apply this the control is flipped around so that has got the orientation let's just delete that constraint because it was just temporary for now so as you can see the shoulder control is completely zeroed out had that little minus there but don't worry about that it's pretty much at zero anyway so the shoulder control is at zero all the offsets have been transferred to the offset group here and what we can do is we can just say lock and hide that lock and hide selected so the Annamayya even though if they accidentally pressed up you know and picked the group they can't do anything to it all they can do is use is edit the control so we can select the control select the joint and then we'll just have maintain offset on just so it keeps everything clean click apply and now our control has no values on it our joint yes does have a translate value on but we're not bothered about that because we're going to use the control to move it around but the main thing is there are zero values on the rotations so if I rotate is that down let's rotate minus 25 if we look at this the joint minus 25 there are some my new values here but there negligible really for this sort of rig the main thing is that key points as this rotates because the values between the control and the actual joint are so close it's going to eliminate any drastic flipping you get you know when you're animating now there may be you know I can't stand here and say that doing it this way you will never get any flipping but it will drastically reduce the amount of flipping that you will get so that is just how I sell my controls I always make sure the control is exactly the same orientation as the joint and I always make sure it has an offset group above it and then you can apply any transforms or anything to that group what it also means is if you are creating a rig and you need to control your control so let's say you needed it to blend between one position and another and again just as we discussed previously when we were looking at the constraints if you applied that to the actual control itself so you ended up with all this being controlled by a constraint if you then try to animate on top of it you could do that but then it would add another node in there and it would just complicate things so again using this offset you can then add all the constraints and things on to the offset and it just keeps the control nice and clean so how do you go about creating your own custom controls and what I mean by custom control is a unique shape which represents an area of your rig so what I did before is I used a NURBS circle so if I just go to create NURBS primitive circle now what you can do is you could just edit the circle the most basic thing to do so you just right-click you could edit the control vertex vertex or the curve point whichever you want no control the / / text or edit point I meant and with these if I just make sure turnoff symmetry let's say we select those four points scale them in there you go you've got a unique shape you can edit these to do whatever you want to represent whatever you want and that's quite simple so that's just one way of creating your own unique sort of shape and if you need more points in there you can edit the sections so let's say bump it up to 20 Edit point as you can see there we've got a lot more points to play with so we could then select these scale them in so that these points and I'm only doing this very quickly but you get the idea just create whatever shapes you want and then you can use them as your controls so that's just using the NURBS circle another option is to use the the actual curve tools so you could use a CV curve tool or a AP curve tool edit point curve tool and you can just draw out your own shape like so and then use that as your control so let's have a look at if we were going to create say an eye so create NURBS primitive circle so I would start off with one circle like so and let's say that represents the iris I could you okay that scale it up scale it out like so and then if we wanted to be fancy we could edit this so it looks a bit more like an eye you get kind of get the idea there you could even have a third circle in the middle for the pupil so I'm just going to freeze the transforms on both of those and delete the history now the problem we have with this one is we just we don't really want to icons unless you want an icon that's going to control the eye and then a separate one which controls the size of the pupil maybe but let's say for argument's sake you just want one control that's just going to have extra attributes on to control the eye well you could just pair up one to the other let's just change the name of this to iris and we'll just say that's eye you could just pair it one to the other and there we go but you've still essentially got two icons there and when you've got quite a complicated rig it just adds another layer of complexity to it so if you want to just simplify this so it's just one icon how do you do that without having to pair in them you can't combine them so we have to turn to a bit more of melt and a bit more scripted and we Cannings we have to use the parent command directly using the script and before we use that what we have to do is we have to expose the shape nodes so I'm just going to right click in the outliner ensure the shapes if I expand these so you can see we've got the transform nodes here and the shape nodes underneath and what we want to do is you want this shape node to be under this transform node no we want those all the way around because we want the iris to be under the eye so we could drag that down see if we could parent it to the eye but that doesn't works it drags the transform to it too so instead we use this bit of script so what we're doing is we're saying parent the shape and parent it relatively so we select the shape node and then the I transform because we want the shape node to go under the transform we run this as you can see both the eye shape and the iris shape are now under the eye transform so we can delete that redundant Irish transform iris not Irish sorry so we'll turn off shapes so we're just looking at the main transforms and there we go we've just got a single icon we can see down here that it has two shape nodes but that doesn't matter because we've just we're just left with a single icon which just makes things a lot cleaner a lot tidier you know and it means that you've got another level of freedom when you're building your controls and like I said before if you wanted to controls so you could control the size of the iris maybe or the pupil then that's fine you could just parent one to the other but another option is to add on is to have your have your eye controls but then add on extra attributes which you can then use those attributes so then drive something else so to add an extra attribute we go to modify add attribute down here this brings up this control box and we're just going to stick with these basic properties here so let's say we wanted to control the pupil size pupil size and I put in an underscore that because it doesn't you're not allowed to use spaces basically so we've got our name so we need to decide which sort of attribute we want and the most popular one is a float and if I add this we see it pops up here and we can scale that up and down and a float just means you can have point numbers so it's four point three there as you can see as I move it up and down we get an extra degree of flexibility so if I undo that but like say we wanted to do something different if we change it to an integer click Add and this will just mean it just stays at solid numbers as you can see as I scrub up and down there's no point values it's just all solid numbers now perhaps you just want to switch something on and off so let's say just call it pupil you could have a boolean click add and there you've got the option and with your you can scrub the on and off just like you can with anything else with the middle mouse button on/off on/off and these are good for controlling visibility or something like that now a string just allows you to input some text and but an enum is quite a good attribute to have as well so if we say pupil maybe it's we're controlling the pupil color as you can see down here we've now have these two options green blue so maybe we could just say red add in a red OH didn't do that right let's try that again pupil color select down here and down here we add in the new name red press return Brown press return so you have lots of that you can add in like the bull in you had on and off down here you can add in your own custom attributes we click Add and then you get a drop-down box and you can just scroll down and add any of those in there you can also scrub through those as well so we're going to look into adding attributes a bit more later on you know in the in the series but that's just basically you could create an eye control and then you could add an extra attributes as many as you want down here and there can then be used to drive something else so that is just a very brief overview of how to create your own custom controls like I say it's not difficult you can just go in and create your own custom curve make it any shape you want and just using that little bit of script there it just means that you can you know combine those different shapes to make a wand shape so the next thing I want to show you is well firstly how to change the color of your icons as you can see here I have a control toolbox setup and this is just to control a face so it's used with a face rig and a one side is blue the middle is red and the other side is yellow now this is quite simple all you need to do is go its select your control go down to drawing overrides here make sure it's switched on and then you just change the color like so and you can choose an RGB value or you can go down to index and then you can slide up and down a whole host of sorts of preset colors and that is very very easy you know you 2 minutes of a job well 2 seconds of a job and that's just how you change the colors so as you can see here you know that's how I achieved these different colors for this facerig but the main way I wanted to show in this section is how you can make one curve deform and follow another and if we focus on the mouth area here we can see we've got control here which controls a whole mouth so we can move the mouse up and down we have a control in each corner of the mouth so we can raise and lower and you know move this in to make the lips pucker the same with the other side and then we've also got our control which edits the middle of the mouth but the problem is we've got this extra loop here and we ideally want it to follow as we move these around and deform and this is purely a visual thing but it's quite nice to have this in your rig so that it just makes it a lot easier for the animator to work with because this now this is just basic but you could have this face sort of overlaid in front of your actual model and have these curves following sort of where the actual lips go so the animator could just animate looking at this and because these curves follow the actual mesh mesh geometry this will be a visual representation of what the face would look like and this could be useful for performance issues save a high density model and you're trying to animate it but it's taking ages for the model talk there you can hide the model and then if this closely follows the edge loops then well how are you animate in the face here is going to be represented on the model but anyway let's go back so let's say we want this to follow these corners and these controls so what I'm going to do is I'm going to go to control vertex if you it won't work with edit point so you have to use control vertex if I select two like so and move that around you can see that the curve is deforming just as I'd like it to if I was moving this control so those selected I can then go to well actually I'm going to select all four of those because I want them all to follow this control and go to deform cluster and that gives me this cluster handle and what that is doing is that is connected to those four components that I had selected if I move that handle around you can see that now moves so all I need to do is just hold down shift select the control press P and that's just parented that cluster to that control as you can see now as I move the control around the met the curve is deforming with it and I can rotate that as well and we can just go in and we can just hide the cluster so we can't see that so if I go to the opposite side select the control vertex select those a press G that will repeat the last command so that has added a cluster then I hold shift select that control press P now it's coming up with this warning down here and it's nothing really to worry about but if you are concerned you can always just select the close to handle in here and move that up manually and then you don't get that issue and the handle stays in the same exact same position and now it's under that it's parented to that control I'm just going to hide it move that around and that one's done so again I'm going to select this point here because I want that to move with this control press G to create a cluster so that's this point here so middle Mouse drag it up same with the bottom press G to repeat that command and then I'm just going to drag that to the lower control just come in here and hide these so they're that controls the bottom that controls the top and then this control which is parented where the all the other controls are parented to we can move that up and around and the whole thing is going to follow so now the animator can move these controls and like I said before if these curves more closely follow the shape of the mouth as you're animating like this depending on how your rig set up obviously you're getting a much better representation of how the actual model will look so you can see there we've got sort of a slanted mouth and then we could maybe open the mouth up a little bit I'll close it together and we could do the same up here with the eyebrows so we've got our main controls but then we just add a nice loop around them and again it's all about that just visual representation just making the animators life much easier really so in this final section on this video all about creating and managing controls I wanted to bring to your attention a couple of recent additions in Maya and but when I say recent it's probably a mayor 2017 when these are brought in but just creating the controls is all well and good but mayor still doesn't recognize them as controls they're just NURBS circles as far as Meier is concerned now why would we want to tell Maya that these are actually controls well there's a lots of benefits from doing this and I'll just discuss those as we go through the process so one of the first benefits is if I select this control here and you know a lot of animators as they're working they like to pick walk up and down the hierarchy so for example if I'm working on the wrist and I quit want to quickly get to the elbow I can just press up on the keyboard and that should have picked walked up to the elbow but the problem is as you can see because of the hierarchy we have here it's pick walked up to the offset group so that doesn't work so that means that the animator can't quickly pick walk through the rig and the hierarchy so let's just go up to our control menu at the top here we have two options Tigers controller and parent controller so what I'm going to do first is I'm just going to go select each of these in go Tigers controller and as you can see down here it's added on at at a tag node do the elbow and do the rest so if I open up the attribute editor let's have a nosy at the actual node itself so it looks pretty basic now the cycle walk we're going to look at in a minute but while we're in here we have this visibility mode now not overridden it means that the visibility of the control isn't affected now what's neat is you can change this now inherent parrot control we'll just do in this instance what the elbow parent does it controlled us but what we can do is change it to show on Mouse proximity so if I select that you'll see that the controls disappeared but as I move towards it you can see it there it pops up if we do it with the elbow as well and also the shoulder so as you can see I can be looking at a rig it could be animating and I could think well I want to edit the elbow and as I move my mouse towards it the control comes up is visible I can select it and as you can see as I'm moving around when the mouse becomes close to one of those controls it's showing it for me so that I can then edit it so I can then go in and I can edit the elbow don't edit the wrist as soon as my mouse cursor gets near the wrist there you go and the same with the eight yet shoulder so that's quite neat a nice little addition I'll just turn that off for now just for the purposes of this tutorial so yeah we'll go back to what I was saying previously basically we want to be able to pick walk up and now we've defined these as controls we can actually change how the pick walk works so if I select the wrist and we know that if I press up I want to go to the elbow we tagged that as a parent controller now if I select the wrist and press up it goes to the elbow I select the elbow and then the shoulder parent controller I can now pick walk up to the elbow up to the shoulder if I press down it goes back to the elbow back to the wrist so that has fixed that problem for us never mind where they are in the hierarchy because we've defined it here and here we can see the parent is elbow controlled the elbow tag so that has got that set up for us now and that just makes the animators life a hell of a lot easier so taking the time to tag your controls as actual controllers in Maya also has another hidden benefit and that is that maiya can then use what's known as parallel evaluation in conjunction with the GPU to accelerate playback of the animation now I know that sounds quite complicated and is a bit more advanced that sort of and sort of this level of the tutorial calls for but just just know that if you take the time to just go through and tigers controllers and that couldn't be done with a Mel script as well so you can just go through a list of things and tag them all as controllers you know it's just gonna again it will help the animators because it will speed up the viewport and the player back and it will also helps of further down the line when it comes to rendering and things like that as well so we're now at the end of another video in our in this rigging in Myer series again if you have any questions whatsoever just drop them below and I will get back to you as soon as I can if you've enjoyed this video don't forget to subscribe to the channel so you kept up to date with any future videos also a like would be appreciated as well and feel free to share this series with all your friends you know the more subscribers I get the more time I can dedicate to creating more content for you so that's it for this video goodbye for now and I will see you on the next one [Music] you
Info
Channel: antCGi
Views: 40,613
Rating: undefined out of 5
Keywords: rigging, maya, autodesk, rigging in maya, nurbs circle, control, icons, orientation, attribue, editor, add attribute, tag as controller, cluster, curve deform, parent controller, pick walk, groups, basics, help, game dev, fundamentals, game rig, tutorial, face rig, 2019, maya 2019, curve, edit curve, gamedev, game art, game development, game rigging, beginner
Id: gtm345xR2Ao
Channel Id: undefined
Length: 42min 49sec (2569 seconds)
Published: Wed May 29 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.