#RiggingInMaya | Part 4 | Fundamentals | Set Driven Keys & Utility Nodes

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello and welcome to the fourth video in my ringing Amaya series we've covered a lot so far but before we start to look at more advanced areas like inverse kinematics let's take a deeper look into more ways to connect and control elements of your rig in the last video we looked at direct connections but sometimes you need more flexibility when driving one attribute with another so what we will look at in this video are set driven keys and utility nerds and discuss which to use to get the best results so let's start by looking at set driven keys now what exactly are set driven keys well they're basically a way of you to control one element with another but using animation curves rather than a direct connection now these animation curves they are not tied to the timeline down here instead they are tied to another objects attribute so let's just dive in and have a look because I think the best way to describe these is to demonstrate how it they are used so you can see before us we have a basic arm skeleton and I've added in a few key controls and what we are gonna do is we are basically what we want to do is see when we rotate this control down like this we would like these joints here to automatically curl you know so we're adding in to our rig a way to automatically curl the fingers you know just to give the animator a little bit more flexibility now if we did this with a direct connection so let me just open up the connection editor just as we I demonstrated before so a reload left and we know we want to rotate the X so we can select that and we want to control these joints here so rotate X and I think their rotate X as well yep so let's connect those up so if we did it with a direct connection yes we will get it to curl but it's not curling correctly cuz obviously we want this joint here to curl in more and this joint here to curl in even more so rather than them just all curling evenly we want them to curl at different degrees so that's disconnect those so for this a direct connection won't work so let's add in a set driven key so to create one we need to make sure we're in the animation marking menu and we go to key set driven key and to go to set but open up the options so what we have here is we just have a simple UI we've got a section for the driver and a section for the driven and basically what we're going to do is say this one element drives another so we know we want this control to drive these joints so we'll select the control and click load driver now let's select these joints Lord driven it's a little bit bigger so just as before we know we want rotate X to be the main attribute which drives these joints and we also want know that we know it won't rotate X to be the driven attribute so it can slight lash down here now rotor X is at 0 so what we essentially need to do is set a key because this is a starting point so we set a key by just clicking key now we need to set the end point so if we were up to at this down let's say we say let's say at and a value of 40 we want the thumb to be completely killed well now what we can do is we can pause the thumb so let's say we want that to be in further and this to be killed right around like so so now it's paused we can set another key so we have essentially set two keyframes there so now as we scrub and rotate this we go back to zero as you can see now as it animates it's working through those keyframes and you don't need to just have a start and an end if we wanted to we could see it well actually let's say at 20 which is about roughly halfway we don't want the thumb to be in this pause so maybe we want to offset it so let's just reset those and let's see it we want the end of the film to rotate first so maybe we just select some wand and that real t-rex so what position 20 we just want that the knuckle of the thumb the base of the thumb to stay where it is so if we select key so we've set a keyframe on left on ones rotate X and this is at 20 so we're using this instead of the timeline I'll just make this has a clip more noticeable so now if I rotate it you see this jointly staying where it is until it gets to 20 and then that will kick in so set driven keys are a nice way have been able to animate something which is driven by a control rather than a timeline you know and you can do more with more bespoke animations and this and just be more creative adding more keyframes now what's more is these can be edited as you can see as we rotate this that's kind of an ease in and an ease out which is quite nice and that's how we want it but we can also go into the animation editor the graph editor I'll just shrink this down close this window for now if we select the joints we can see the actual keyframes that have been added as part of the set driven key so we can select all three and we can see there that they're easing in and out so we can adjust those tangents as well say we want it to be more linear we can just use these up here to adjust the tangents like so so now the animation is going to be much more linear you know much more robotic and perhaps that's how you want that particular thing to animate you want it to be more robotic more rigid so you can do that as well perhaps this element here this part of the thumb is rotating too much so rather than just deleting the set driven keys and trying to re assign them you can just go in and you can edit these keyframes here so we could move that down a little bit and then we've got the flexibility to edit those keyframes to get the exact movement that we want and obviously you don't need to have it connected to the real T you could add in a custom attribute and have that driving the set driven keys to get the fingers curling you can do whatever you want and that is pretty much what set driven keys are and how you can set them up and just quickly edit them now the problem with set driven keys is you don't really want the animator to have to come in and edit the rig and edit these curves to get the fingers to curl the way that they want so essentially when you've finished setting up the rig you only want the animator to rotate this you don't want them to have to go in and tweak any of the animation curves and that gives you a well a slight problem really in that it locks down that particular movement and what if you wanted to give the animator a bit more freedom like we did we adjusted this enough call because we didn't to wrote it as much but like I say you don't want the animator going in and playing around with these curves because then things start getting complicated and the rig could end up being broken and what if one animator wants the curves one way and another animator wants them another way you know things just start getting complicated and things you know there's just more of a risk of rigs ending up different and then when animations get exported and transferred you know it can just cause headaches so what I'm trying to get across it once you've rigged the character and you've added the set driven keys that's it they're set in stone you can't edit any of these and you don't want the animator to go in and edit them so this is where set driven keys are quite restricted so the other option and that's what we're going to look at next is to use utility nodes and they're I use utility nodes much more than I than I do with set driven keys they just offer much more flexibility now they do have downsides as well so you sort of have to way up which approach is better for that certain element of your rig but let's just let's leave this here and we will look at utility door the next and then we can discuss what is best to use where so we've now had a really quick look at set driven keys how to set them up how you can edit the animation curves you know just a brief look at how they could be used in creating a finger curl so now let's take a look at utility nodes and how they can be useful and what the benefits are to using those as opposed to animator set driven keys so what we have here is a really basic reverse foot setup now if you've created a reverse foot before you'll have seen this and you know the basic idea is the I care handles are parented to these joints here and then you can use this to control where those I care handles are and they in turn control the base skeleton so you have a he which you couldn't control here and it's called a reverse foot because it's evaluated in Reverse and this allows you to be able to you know roll there on to the ball of the foot here and then if you roll the actual end of the tour you know it lifts the rest of the foot up but we can I'll show how to set this up properly in a future video but this just allows us to demonstrate utility nodes in quite a simple way really so with this we have a rural attribute on the control and what we essentially want to do is when we adjust this when we move this up and down so when we roll move it one way we want the foot to roll onto the back of the heel and at 0 it goes back to here and then we want to route it up onto the ball of the foot and then finally up onto the toe now there's a lot of movement there but we can use utility nodes to gradually move from one to another using just one attribute so let's go into our node editor and just squish this down and see if we can get it all fitting onto the screen so here we've already got our heel joint in the scene so let's add our control alright let's try that again and he'll there we go so we have our main control here and we have our heal joint so the first stage is we want to rotate back onto the heel so we have our heel joint here and we want to rotate the x-axis here with the rule now if we directly connect that like so if I then adjust rule see we get this but essentially what we want it to do is when you when you go into maybe if you're going to the minus value then it will go up onto the heel if you go into a plus value then it's ignored so we basically all we want to do is say if it's greater than a value ignore it if it's less than a value then rotate it now we could do that using eccentric and keys obviously we could just set key at the start unless it's a key at the end but for this obviously we're using utility nodes so let's bring that connection so what we can do is we can use a condition nerd now I'm just pressing tab and that brings up this little box and then you can type in like so and then it brings up all the utility nodes with those letters in so it's like in that neat little search box so I just want a condition nerd and I'm just going to open this up now what our condition node does is probably easier to demonstrate looking in the attribute editor so a condition node is like an if statement when it comes to programming so basically what you are checking is you're checking against two values and then if something happens or is it a specific difference then you do something there's an output so we can see here we have the first term and the second term and what we're doing is we're comparing that value with this value and down here is the operation so basically at the moment is unequal so we're saying if the first value is equal to the second value then do this value because it's true but if it's not equal then you output this value because it's false and there's lots you can do here you can make it so if the first term is not equal to the second term then do something if the first term is greater than greater or equal less than or less or equal so you can see there's lots of different options there so we know that we want our rural attribute to the be the main controller so let's say the rule goes into the first term then let's just keep that attribute editor open so that we can see yellow because we're connected so what we want to say now is like if if the first term so which where does this rotate if I rotate this up so it goes into a positive value but I maybe want it to be - so let's say at - but - 10 we want this heel to be pointing back so what we can do is we can say well if the second term is less than the if the first term sorry is less than the second term which it is now because it's a minus 10 then use this value if it's not then use this value so because we want to ignore it we want to say if it's false then it's 0 because if the first term is not less than then it's obviously greater than so then we want it to be 0 because we don't want anything to happen so what we could do is put the role into the color if true as well and then because we're just using the our values which is just this first section here we've got our G B we just want the out color R so we want the output from that are there so let's put that into the rotate X so now what's going to happen is when it goes into a minus value it's going to use that value as you can see now it's rotating the wrong way so we can add in another node just to fix that but as soon as it goes into a post value is being ignored and then we could use another node to control the next stage of the form so as you can see we're going down and up down and up but like I say this is going the wrong way but we can do an easy fix on that what we could do instead is use another node just to reverse that output so there are a number of different ways you could do this but I'm going to use a multiply divide node so rather than outputting directly to that real tier X I'm just going to delete that connection and I'm going to input this the output of that into input 1x now this ILDA it all does sound quite complicated but once you start getting into utility nodes they're very very useful and very very very very powerful so let's open the attribute editor again so we get a clearer picture of this so I've just put the output of this into here now if I multiply it by minus 1 that is going to reverse it so now we can use the output X because obviously we're doing this first so X Y Z which is a bit it's a bit funny isn't it because in the multiply node is XYZ but in the condition node it's RGB so yeah it's bit to get your head round so the output X let's put that into the real 2x instead so now we've reversed that value so now when we when we go into a negative value it's now going to bring the heel up and down up and down and then it's going to stop there so that's the first step so let's just rename some of these just so we can keep things clear he'll condition he'll multi now the thing is we've got three values here like we say we got RGB here so you could have two more things being output on this particular note from this particular node the same with the multiplied in up divided nerd we're only using this one section here in this instance the X so we could connect something to the XY the y&z as well one more thing with the multiply divide node that I didn't you obviously you've got these different options so we use multiply but also you can use divide and also the power so you've got other options there so I don't want to dock that thank you very much so we've got the first section done and it goes back on the heel so now what we want to do is when it goes into a positive number we want to start second stage and rotate the ball of the foot up so we can add this end let's just remove the heel for now and we'll remove that so we can do exactly the same we can use a condition nerd so let's call this ball conditioned and just like before we're gonna use the roll value as our first term now we have values on here because that's just cuz I just cook I duplicated the nerd so let's just experiment and let's just say so we know that this time we want it to be a positive value so we'll set that to greater than so if it's greater than zero then we want the foot to the ball to rotate so color if true will give us that value so then we want the output R to go into the rotate X so now we got when we go back the heel goes up then we go forwards and the ball goes down which a bit frustrating now we could just flip these around so we don't need to use the multiply divide node but for me in my head a positive value would mean that the foot rotates forward and a negative value would mean that the heel goes up so if I'm thinking that then maybe it makes more sense for an animator to do that so just putting in these extra you know steps and these extra nodes just make things make more sense yeah how did you know I mean so we've got this and again we need to reverse it but we've also we've already got a multiply divide node in here so we could just use it again this time input into the Y so we want the output Y make sure the second value is minus one because we're multiplying by that and then the output Y can go into the ball rotate X so we're going back on the heel and then when we go forward the ball is rotating up like sir so that's stage two so now we want to move to stage three and that is to get the tool to go up but only once the ball has reached a certain point so let's decide where we want that to be first so maybe let's just keep it a round number of ten perhaps so we've got that condition that condition so let's just duplicate that and create another condition let's just move these out the way just running out of space here on this tiny screen we'll call that - - a condition let's get rid of the ball and now just to keep things clean add in the toe and again we want the real tier X so just like we did before we're going to take the Royal attribute put it into the first term and also put it into color if true are so that set up okay and then if we open up the attribute editor let's just make sure so this time we want this first term basically we don't want this to trigger until it's after that till it's over a certain value and that value is ten so this time we can change the second term to ten so this is not going to get triggered until this is over ten and I suspect we're probably going to have to use the multiply divide node again so let's just put that in there and because we're using the input Z will change this output Z as well and we'll wrote it to the royalty X yep so they've ever headache when you going through all this so when it goes back onto the he'll forwards up to the ball and then see we didn't minus that value so let's just - that like so just to reverse it so we now have a foot where when you're going to the reverse the heel goes back and then when we're going to a positive value goes up onto the ball and then up onto the toe but the problem is that you can see we're getting a slight jump when it comes up onto the ball of the toe and that is because if we open up our condition note again we're saying that we want when the first term is greater than the second term then we want to use this value here to drive the end of the toe but the problem is this value because we're using it directly from the role attribute is always going to start at 10 so that's adding 10 onto the end of the tour so that's why we're getting that jump so what we essentially need to do now is remove it always take that value away from this value so in this instance we just want that to be 10 so we can use another utility in order to do this this time we're going to use a plus minus average nerd and this does exactly what the name suggests you can add things together you can take away a list of things or you can average out and get the average of a list of attributes so we know we want to take away ten from the role attribute so let's put that into input one D now you'll see down here input 1 D 1 as appeared but it hasn't appeared in the attribute editor and that's just a little bit of a book so what we're going to do is just going to connect like so and then disconnect so that's just added that in there and that allows us to then change that to 10 because that's the value that we want to take away and I'm going to change this to subtract so this is always going to take 10 away from this value so now instead of using rule directly as our color if true value we're going to use this edited value here as you can see that as had the ten taken away and it's a value of nought point three now we do it at this stage because this is the value being evaluated by the condition nerd if we added in the plus minus average sort of later on at the stage down here just before it got put into it got connected to the actual joint itself then you would be taking ten away from here so basically the condition node is checking what the value is before it's being evaluated whereas if we added in the plus minus average but over here it would take ten away no matter what the value was so you'd end up with the the bar at the end of the foot rotating to minus ten so we've added that in and that's just going to take care of that little jump so we can go back onto the heel in the minus value then up onto the ball and then up onto the end of the tour you see we got a nice motion there now it's not perfect because ideally we want the ball of the foot as soon as the toe reaches a certain point you want the ball of the foot to stop rotating but that's adding another level two to this this rig and in this video I'm just introducing utility nerds and demonstrating how they can be used and how they're better in some respects and set driven keys and like I said you could maybe use set driven keys to drive this foot so you could say we've got a key there a key there a key there and then a key at the end and that's it done but the beauty of the utility nodes is we have all these extra values you know and we've got all these extra attributes like this value here for example we added that in because we wanted it to a value of 10 when it's above 10 that's when the ball of the foot what will the toe of the foot starts to peel away so you could connect that to an attribute which then allows the animator to dictate where that point of the foot is and I think to demonstrate this in a clearer way I'm just gonna load in a foot rig that I've already built so I'll just learn that in now so this is a foot rig but I've already built using utility nerds and this will demonstrate what I'm trying to get a lot across a lot better well a lot easier really so you can see we've got lots of different attributes here so we've got our roll and the foot goes back up and over and that works quite well you know we've got it locked so that the foot can't go back any further than we need it to or forward you know what I've also added in is a bank so the foot can bank left to right the heel can twist to twist you know all the usual stuff and a toe tap and these are all done with utility notes now the beauty of using the utility nodes is we've got these extra section here and that allows the animator to tweak the foot to suit that particular character so if we look at our rule the heel goes back so far but maybe the animator wants the heel to go back further so we've got a rollback attribute here which we can adjust and now the animator has control over where that foot will go back on its heel you know just the same as when the foot grows forwards you've got control over the end of the foot where it finishes here you know you can adjust that what you can also do if I rotate the foot like so just as the the ball of the foot gets to a certain position the tour kicks in you know just as we set it up before but if you bent your foot like that you know it might you till area might Bend like that if you are barefoot but what if the character is wearing stiff boobs then the animator has a flexibility to adjust this to a flex amount here so if I rotate the foot up like so say it to five I can adjust the toe flex that's going to pull that back let's have it at point one and you can see now the tour is a lot stiffer so if this character was wearing boots you know obviously the leather isn't as flexible so that will only allow that tool that ball of the foot to bend so much there's also a attributes in here to edit the amount the football bank obviously as I scrub through it like so you can adjust the bank amount because maybe the foot needs to twist that little bit more and as you can see this is a flexibility you get with utility notes it's not just the case of making the foot girl from A to B to C you're doing that but then giving the animator the freedom to tweak where a B and C are you know and you can't do that with set driven keys because obviously the only way you can do that is to go in and edit the curbs manually but then it leaves the rig open to it being broken or if you're a number of animators are using the same rig you know if they're all editing parts of the rig you know it just causes problems further down the line so once you've at once as a technical artist once you've created that rig it needs to be set in stone the beauty of this is these can the keyframed so one artist will keyframe these at one value another out well another animator will keyframe them a different value but they're not actually changing the fundamentals of the rig I hope that I've got sort of all that across sort of the main differences between set driven keys and utility nodes and how one can be more powerful than the other now I did I have sort of focus more on the utility nodes and like Sayla I use them a lot more because I think they allow a lot more freedom but looking back at set driven keys obviously you've got a look if you know that your move the movement that you're trying to achieve is just one movement and you need to have the flexibility to be able to edit those you know the tangents to ease-in and ease-out then set driven keys will be perfect for that but if you want to give more flexibility to your animator I would use utility nodes so we've come to the end of yet another rigging in Maya video like I always say if you have any questions whatsoever leave them below and I will get back to you don't forget to like this video and also subscribe to my channel there I've got lots more videos planned in this series and there's lots of other things that I plan to do in the future all to do with different sorts of artwork not just focused on Maya but there will be other applications as well so stay tuned for more so that's this video done for now goodbye and see you on the next one [Music] you
Info
Channel: antCGi
Views: 26,503
Rating: undefined out of 5
Keywords: rigging, maya, autodesk, maya3d, rigging in maya, set driven keys, sdk, utility nodes, condition, multiplydivide, plusminusaverage, connections, rig, reverse foot, foot rig, finger, finger curl, multiply divide, plus minus average, node editor, nodes, 2019, maya 2019, gamedev, game art, game development, game rig, game rigging
Id: vlXDe2D5qYI
Channel Id: undefined
Length: 36min 13sec (2173 seconds)
Published: Wed Jun 19 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.