#RiggingInMaya | Part 15 | Intermediate | Face Rig - Blend Shape Controls

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello and welcome to video 15 in my rigging Amaya series previously in video 14 we explored blend shape creation as we built the main shapes we need to animate this guy's face what we're going to do now is connect the controls to these shapes in effect driving them while also making for a simpler and more user-friendly experience for the animator now before we dive in I just wanted to mention that you can now download all the source files for each part of this rigging in Maya series from my cube brush page you can find the link in the description below while you're there why don't you grab some of the other tutorials models our rigs I have on offer most of free but if you'd like to help contribute to these videos all donations are welcome alternatively if you enjoy these videos why not simply treat me to a coffee as a way of saying thank you just head to coffee calm /and cgi supporters now get exclusive rewards and early access to videos not to mention a private invitation to my very own discard channel also keep an eye out for this popping up throughout the video when it does it means that as an added bonus I've written and uploaded a script which will help speed up that particular area of the rigging process right let's dive in here we have the scene pretty much where we left off previously the jaw is still joint driven to give us maximum freedom of movement and so are the eyelids and the eyes I think these are always better controlled with joints rather than blend shapes if you select the head you will see that we have our blend shape node head underscore BS and all the target shapes we created previously just waiting to be rigged if you open the shape editor you can also see them all in here too we have all the shapes which we can adjust an anime if we wanted to what we need to do now is make these controls drive the blend shapes so this will affect the lip this one will work the sneer shape and this will pop out the cheek the global mouth control will need a different approach so the lips will follow it let's start by looking at the cheek and this setup can also be applied to many of the other controls it's quite simple really open the node editor just move the let's bring in the cheek control and remove the shake node select the head model and then the head blend shape node and bring those into the node editor to will remove these because we don't need them if we expand the head blend shape node you will find the way attribute expanding this will reveal all the blend shape targets so here is a left cheek shape let's expand the control and the translate attributes we want the blend shape to be controlled by the control Z translation so let's connect that to the left cheek blend shape target if we select the node you can see in the channel box that it's tagged yellow meaning it has an incoming connection if we move this control now you will see the cheek does expand but we have a problem where the control has to move quite far before anything happens it just moves too far away from the cheek this is because the translation value is too small so we need a way to increase it let's delete this tab and start to type multiply and then select the multiply divide node call this cheek BS multi so we know what it's used for just expand these oops here we have input 1 which is a primary number we want to work with below it is input 2 which is the value we want to multiply or divide the primary number by over here we get the result we know we want to work with translate Z so connect that to input 1 X with nodes like this the X Y Z is irrelevant really it could also be 1 2 3 or RGB as it is in some cases so don't get too hung up on the attribute names again we can see up here that it's connected now connect output X to the left cheek attribute if we added this now nothing much happens because the multiply divide node is only multiplying the translate value by one so it's the same result we need to change input to X because this is a value which the translation is being multiplied by so input one X is being multiplied by input two x and then output is the result let's try 10 you okay that moves more but not enough let's try 20 instead that's closer but I think we can go further we need it to look more like the control is actually pulling the cheap geometry what we can do is scrub the value until the cheek is in the right position that's much better so let's round that up to around 35 okay looking good and you notice we can also push the cheek in as well as pull it out using just the one blend chip let's reset that we can connect the opposite cheek now and use the same multiply divide node it has three inputs after all so there's no point in adding a new node bring the right cheek control into the nerd editor and remove the shape node let's open this up we need translate that again just move these around Connect translates out to import one why this time now we need output why because we are working on the Y attributes connect that to the right cheek blend shape let's also make sure the input to Y attribute is the same so we get the same movement there we go that sheet works we can now select an animate both cheeks at the same time so those are now done I told you it was a simple setup let's look at the lips next with these controls we can use exactly the same approach I'll just close this for now the difference is we want this controls Y translation to trigger the blend shape not the Z translation because this is a simple but repetitive tasks I've created a handy little script for you to download which will automate this process here is so this will scan the scene for the blend shape nodes and list them all here we only have the one in this scene so that's already set for us if I first select the middle control we can choose which axis will drive the blend shape we only need Y for now so disable X and Z the connect Y checkbox ties into the wide driven blend shape drop-down box this is where you specify which blend shape target the y translation will drive this needs to be changed to lips or / middle we also have the scale multiplier and this just sets the amount the translation is multiplied by just as we did previously with our multiply divide node actually let's change that to 35 as we were using previously click go and that's connected if we try it we can see that the lip needs to move more what this script also does is add an attribute to the control so you can edit the amount the translation is multiplied by it just connects to the multiply divide node so it's easier for the animator to access let's scrub that so the lip is roughly in the right place okay 70 works that's better much closer to the controls movement let's look at the lower lip now actually let's just change the scale multiplier to match the upper lip control so we'll change this to 70 select the lower lip control and we need to change the blend shape it will drive so this should be lips lower middle and click go so the lip is moved with in the wrong direction as you can see we have the opposite movement this is easily fixed though we just need to change the multiply amount to a negative number so change this to minus 17 step there we go that's fixed the middle controls are wired up so now with output this script we can quickly go through the rest select the left outer lip control change the blend shape to match around you there you are left lip upper outer and click go that's done and corner so change this to left lip or / corner and act up so you get the general idea of how this script works so what I'm going to do is I'm just going to quickly speed around and do all the rest and get them set up you okay that's the upper and lower lip controls setup if we raise the upper lip you see we have that nice uniform shape which we spent time creating in the previous video we can do the same with the lower lip too the corner controls just like the mouse control need to be set up differently but we will come back to those later let's move up to the sneer control so we need to change this to sneer too Oh wrong shape just undo that set this to sneer not squint let's reapply that that's better now we can do the squint okay that's done move over to the opposite side do the sneer and the squint so those were easy enough and if you don't have this script just refer back to see how the network was created it would make sense for us to now redo the cheeks just so everything is set up the same with the same attributes added on to the controls open the node editor again and the cheek nodes should still be here yep so just delete the cheek PS multi-node that frees up the cheek control again let's just close up we just want this attribute on here like the other controls with this control we need the Z translation to drive it so deselects connect Y and instead enable connect Z because we are working on the Z Channel we need to focus on this drop-down box change this to left cheek and click go that's done hop over to the right cheek change this to right cheek and apply that that's done - let's look at the nose next with this control we need to work with two of the axes Y and also zet we have to blend shapes to work on in this area the nose rays and the nose stretch change Y driven blend shape to nose rays we don't need the x-axis to do anything so uncheck that and now set Z driven blend shape to know squash with this control we need to work with two of the axes why and also Zed this is because we need the nose to move in two directions so we can activate the nose rays and also the nose squash blend shapes click go again and that's now added both directions and we have two multi attributes to play with let's try that so the no squash is inverted so we need to fix that nose rails looks good though let's change Zed multi to -100 instead to fix that movement that's better we can now pull the nose around although looking at it we could probably add in another shape to move it left and right to this is what I mentioned in the previous video sometimes it's better to work with these controls wired up so you get a better idea of what shapes are needed the good thing is we can easily add in another blend shape targets and then connect it up to the control later so I think that's what I'll do at the end of the video so you'll be able to see this when you download the source files okay those are the basic controls connected so let's look at the corner of the mouth we can't just rely on one direction for the corner of the mouth if we look at the shapes we have we have a wide shape arrays and a lower and also if I can find it and narrow all four of these need to work off this one control let's go back to the nerd editor we don't need the cheat controls anymore so let's remove those and bring in this karna control just arrange these you this time we are going to use a conditioned node first so press tab and create one rename that to left mouth corner condition actually let's change that you why'd that makes more sense open these attributes you and open the attribute editor so we can see it a little clearer if you followed along with this series you will have a good idea of how this note works but I'll go over the basics for any new viewers we want the X translation to drive both the wide and narrow shapes so connect translate X to the first term attribute on the condition note we can see this is now connected over here so what this will do is compare the first term with the second term and check them against the current operation we need this to be set to greater them because we are checking when the first term is greater than the second term I'll just move the control so we have a value to work with if the first term is greater than the second term the condition node will use the color if true value here if it isn't it uses a color if false value so let's also connect the translate X attribute into this as this value will also drive the blend shapes we need to use the out color our attribute because that represents the first rule here connects out color our to left lip wide if we try the control now we can see it's working yes there is a bit of a jump but that's expected when we go into negative figures what we can see is a corner moving slightly when we are in positive figures just as we had with the other blend shapes so we need to multiply the value again to increase the movement first let's stop that jumping this is because when the first term isn't greater than the second term so when it's less than the second term the output is coming from the color a false attribute instead and this is set to 1 so the blend shape is automatically being set to 1 as well so this is why we are getting that snap we don't want this instead when the value isn't greater we need the blend shape to be turned off so let's set that to 0 so now you see we only have movement when the control goes in a positive direction let's create that multiply divide node I mentioned earlier and rename that so it's the same as a condition nerd but with multi on the end instead just so we know that they're both connected connect the out color are two input 1x an output X to the left lip wide blend shape this is set to 1 by default so we now need to increase how much this value is x so scrub the attribute to get a basic number ok 80 looks good just round that off just because I prefer nice neat numbers and they are easier to remember that works I can now pull the corner of the mouth out also unlike the other controls like the lips and the cheeks when I move in the opposite direction nothing happens but this is exactly what we need rather than the Blanchett going into negative figures what we want instead is to trigger a different blunt shape so in this case it will be the lip narrow so rather than set up a new network we can use the same nodes in the attribute editor you can see on the condition node there are three columns so we can simply use the second one here Connect translate x2 color of false G by doing this what we are saying is that if the first term isn't greater than the second term so it's less than it's going to use this false value instead so we can use this to trigger another blend shape because we are using the second column we need the second output so connect out color G to input one Y again we are using the multiply divide node to control how much this value affects the blend shape connect output Y to left lip narrow let's also update input - why with the same value as we use before okay so that looks wrong but it's because we are inputting a negative value which is coming from the X translation into the blend shape so the vertices are moving in the wrong direction we can easily fix that by setting 82 - 80 instead okay there we go the corner of the mouth now moves in and out each direction triggering a different blend shape so let's recap when the first term is greater than the second term which is being defined by the operation the condition node uses the true value here so the wide blend shape is being set to this whereas the narrow is using this value here if the first term is not greater than the second term the value changes so the wide shape uses this value instead and is set to 0 whereas the narrow is then set to use this value and starts to move I know it's a lot to think about but the best thing to do is play around with an experiment it makes more sense when put into practice that's the wider narro done let's now look at raise and lower this is exactly the same setup except we use a wide translation instead of X duplicate the condition and multiply divide nodes and let's remove these from the nerd editor move this down open it also renamed it to raise and open these and do the same with this nerd you so we need the Y translation connect that to the first term attribute it's just organize these again when the first term is greater than the second term we want to use the color if true value here so can I translate Y to color if true our next just move these again we are just repeating the same connections we did with the wide and narrow so out color are goes to input 1 X on the multiply divide node the good thing about duplicating knows is they retain the same settings and values so at least we don't need to go in and set those up again now output X to left lip raise that jumps up now because the blen ship is now active and we have the multiplier value already set that works as you can see the movement is now more fluid because we're the one control we can automatically combine multiple blend shapes let's set up the lower next if you remember we need to use the second column which is the G or green column so translate Y goes into color if false G we now need the output from the G column connect that to input 1y and output Y to left lip lower you can see that's works because they let moved we can now pull the corner of the mouth around triggering for blend shapes at once using just this one control it looks more fluid and it's a lot easier for the animators to just pick up and start animating this setup can be used on lots of things not just blend shapes I've used it many times before to simplify a foot rig for example so moving the one control can activate the foot roll and Bank again making it more user friendly for the animator it gives some physical controls to use rather than them having to hunt down and play around with attributes so time to work on the other corner of the mouth just reset these first the process is exactly the same so I'm just going to speed up the video here if you're not entirely sure what to do just go back and re-watch the section where we do the left corner of his mouth and just repeat that process for the right corner of his mouth at this stage it's more about remembering which attributes are connected to which and if you duplicate the condition and multiply divide nodes you don't need to worry about seeing the values so that's raisin lower done now on to the wide and narrow shapes I'm thinking that I might try and update the script I used earlier with an option to automatically create this set up for you to what do you think if you would like to see this please let me know in the comments below and I'll see what I can do so there we go the right side done to both sides raped you now you have that process nailed you can move on and apply it to the global mouth control here duplicate the condition and multiply divide nodes hide these for now and the corner control - and bring the mouth control into the node editor open that up and we'll just rename these as this is a global control we don't need the are at the beginning actually let's change the wide change that to left-right update the multiply divide node to you open these up you we want translate X to drive these shapes so connect it to the first term move these again if we remember previously we also had to connect it to the color if true our attribute and the color if false G attribute connect those next okay now the outputs go into the multiply divide node so out color are two input 1x and out color G to import 1y where are you okay output X goes to lips left and output Y goes to lips right let's try that okay good both are working and in the right directions now to do the up-and-down shapes duplicate the nodes again and remove the ones we no longer need rename these now to up down and get rid of the one at the end you and open these so translate why this time connect that to first term also connected to color if true R and color if false G yep that's right move the multiply divide node up Alcala are 2 input 1x and out color G 2 input 1 Y so exactly as we did before and finally output X controls the lips book shape and output Y controls the lips down shape just try that yeah it looks good unlike the corner of the mouth this can move around anywhere and the lips will follow so we have control over the whole mouth and each corner too we can also fine-tune the lips too they also work alongside the jaw movement if you find that there's a particular combination of shapes that don't work maybe like this you can always go back into the shape editor hit that edit button and use the sculpting tools to adjust them the blend shapes can be reworked and tweet as much as you like it doesn't affect the face rig it would only have an impact if you deleted a target or replaced it but even then it's just a case of reconnecting it to the right attribute and the right control okay so the only area we have left to rig is the eyebrows we want the inner and outer eyebrows to work off the Y translation because this is a simple movement we could just use a script again which when moving the control directly would work fine the problem is we have this global control which moves both the inner and outer eyebrow controls if you remember the way this setup in this script works is to use the actual translation values if we raise the global control though you will see the individual controls have no values so they wouldn't trigger the blend shapes what we need is a dummy object which will always have those translate values regardless of which control is moving it create a locator imperil constrain it to the left brow inner control turnoff maintained offset so it inherits its position and orientation let's make it smaller you we could use the location to drive the blend shape but the problem is it has transform values so this wouldn't work we need to clean it up so let's delete that parent constraint node for now now go to freeze transforms we only want to freeze the translations so make short rotate and scale are not checked click apply we now have nice clean values on the locator now constrain it again using another parent constrain so it follows where the control moves let's just rename that locator so copy the controls name and replace control at the end with locator if we move the control the locator follows the locator also has translate values if we move the global control instead you will see the control still has no values but instead the locator does so what this means is we can use a locator to drive the blend shapes instead of the control let's open the script again but remember you can also do it manually if you don't have it just refer back to the beginning of the video we just want to connect the Y translation so disable X and Z Y driven blend shape should now be changed to left brow inner and click go ok that's done and connected it works with the main control and also the global control perfect let's do the outer brow duplicate the locator and rename it to outer instead of inner select the outer eyebrow control on the new locator and go to constrain Perrin actually we don't need to use a constraint instead go to modify much transformations match all transformations this just does the same thing but you don't have to go in and delete the parent constraint node afterwards okay I have them selected the wrong way around just undo that select the locator first and then the control and this time just match the transforms next match the rotations we don't want to match the scale make sure you freeze the transforms to zero out the translation values on the locator now that's in position you can use the parent constraint so the locator follows a control that all moves correctly select the locator and in the window set Y driven blend shape to left brow outer and click go right we have an error this is because I duplicated the locator so we also have the y multi attribute on it I should maybe update the script to check for this okay let's delete those attributes and click go again alright that's work this time we can now move the eyebrow as a whole and also individually you I'm going to repeat this now for the opposite side so I'll pause the video here and I'll be back in a second we now have both sides rigged but the locators are sat outside the groups and we need them to be parented to the head control just so they move around with it and they follow with the head if we drag these up you will see we have a problem so what's happening here other locators are having extra transform values applied to them because they are now inside a group so this in addition to the constraints is causing an offset it's not a big deal though all we need to do is delete those parent constraints freeze the transforms to 0 the translation values back out and then apply the parent constraints again so the locators follow the controls remember you can also press G to repeat the last command so rather than going to the menus each time you can just use the shortcut to apply the constraint again to the selection there we go both eyebrows now working the locators also follow the head - just as we needed we'll just test and play around with the mouth - when working with bland shapes it's always a good idea to test that the blend shapes work in conjunction with any skinning you've done okay so I've skipped ahead slightly here as you can see I decided to use the Z translation on the mouth control to drive the pucker shape again just using the script or the initial setup with the multiply divide node what we need to do now we set up the lips clamp / target shape and the most logical way I can think of adding this is into the control scale attribute that kind of makes sense to me because we're using the scale though this needs a slightly different setup make sure you have the node editor open and the mouth control and blend shape nodes are loaded as you can see I also added a new mouth shape multi node which is there to help the pucker control connect scale Y to input 1y also connect output Y to lips clamp what you will see is a lips clamp shape becomes active so the lips have closed even though we didn't scale them this is because the scale attribute has a default value of 1 not zero so this is setting the blend shape to one as you can see here what we need is an offset one which will take away that value of 1 so instead reads a zero press tab in the nerd editor and create a plus minus average node we can use this to take away that initial value I'll just open it in the attribute editor what we need to do is set the operation to subtract because we want to take away that one can x kale y 2 input 1 d0 this connection now shows up in the attribute editor you should also see we now have input 1 d1 below it can X scale Y 2 input 1 D 1 as well so it's connected to birth now select and delete the connection to input 1 d1 the attribute will stay at its value of 1 which is the amount we need to subtract we delete the connection because we don't want this value to change next connect output 1 D to input 1 Y on the multiply divide node you will see the lips return to the default pearls because we took away that value so the blend shape is back at 0 now let's test it okay we need to invert it but again this is a simple task of setting the value we multiply it by to a negative value so we can set that to minus 70 instead ah actually the 78 was for the poker my bad okay so it's the input to why we need to update that's better we can probably increase the influence maybe minus two yeah that looks better reset that oops needs to be one not zero you so the mouth is working nicely now I'll just rename that plus minus average node before we move on what we can also do is use this system so when we scale this control the nostrils flare to you so it triggers this shape although thinking about it this shape affects both sides so we could remove those nostril controls and just have them flare when the nerves control is scaled instead you can always divide the nostril flare blend shape into two if you need it and keep these controls so you can independently flare either side of the nose what I'm going to do now is I'm just going to repeat the process we did for the lip clump and we're going to add in that nostril flare so again I'll pause the video and I will be back in a minute so here we have the nose we can stretch it and move it up and down and the scale now triggers the nostrils we can move around the face now and literally pull areas around to help achieve different expressions you this normalmap stretchy needs fixing maybe an extra edge loop would help around here I'll maybe come back and fix that later because a lot of these controls work off just one attribute we could go in and lock off the rest again simplifying things for the animator if I select the brow controls all I need to do is select all the attributes in the channel box apart from translate Y I can then right-click and go to lock and hide selected we can now only edit this along that one axis let's do the same on the global controls no matter where we move these now they are restricted to just the y-axis this just means the controls don't end up away from the head or across the scene we could go around now and lock off all the other unused attributes to clean up the face controls you you can now pull all these around and start forming expressions you one thing we should do is make sure the lower lip controls follow the jaw so they stay with the lip as the mouth opens you all we need to do is move all those offset groups and parent them to the jaw control instead that's better and it makes more sense for them to be there so you have now seen how to set up a joint based facial rig and also a blunt shape based rig but which is better to be honest I prefer to use a mixture of the two blend shapes are ideal for creating more exact facial shapes but they can be restrictive joints allow for much more freedom of movement and flexibility but the shapes they produce may not be exactly the shapes that you need so with the nose for example I would use a joint so that we can move it around but then use blend shapes to flare the nostrils so I can get a more precise shape with the eyebrows joints would be better and I would have three instead of two you can be more expressive that way and to achieve the same results you would need to blend shapes per area so that would mean twelve in total which could be expensive depending on what platform you are developing for if this is a game model another plus side to blend shapes compared to joints is if you are creating phonemes so if you are creating sort of an a e i o u shape or more precise facial expressions in this instance blend shapes are absolutely the way to go because you wouldn't be able to achieve these with joints not without using lots and lots of joints that is what I would do is experiment and see which works best for your particular character as a setup on one character will necessarily work best on another okay that's the facial sections done now and there's not many more videos left that I want to cover on this particular rig and this particular part of the series what I want to cover over the next few videos are space swapping making the rig scalable and finally locking the rig down and cleaning it up so it can be passed to an animator and you're not worried about them accidentally breaking it or selecting and moving things that shouldn't be touched so I hope you've enjoyed this video if you have please let me know in the comments below also let me know if you have any questions and tell me what future videos you would like to see remember to download the files from my cube brush page so you can follow along with these tutorials and why not say thanks with a small donation via my coffee page as always remember to like this tutorial and subscribe to my channel to keep up to date with future videos this is aunt C GI signing off and I will see you on the next one [Music] you
Info
Channel: antCGi
Views: 16,461
Rating: undefined out of 5
Keywords: rigging, maya, autodesk, maya3d, rigging in maya, rig, 2019, maya 2019, gamedev, game art, game development, game rig, face, face rig, maya face rig, facial rig, game face rig, expressions, happy, sad, smile, grin, cheeks, lip rig, lips, nose, nostril, sneer, squint, shape editor, blendshape, blend shape, mouth controls, eyebrow, condition node, multiplydivide node, plusminusaverage node, node edito, controls, nodes
Id: QhkT_U5S9x8
Channel Id: undefined
Length: 51min 46sec (3106 seconds)
Published: Fri Feb 14 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.