#RiggingInMaya | Part 10 | Spine FK & IK Systems

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
so all the setup is done now we have the controls and the control joints have been added so let's now build the main systems that are going to drive the spine really quick question for you now how would you like to help support the future of this channel and keep these videos free well there are a few options one would be to simply treat me to a coffee at my coffee page as a quick and easy thank you you could also grab something from the ant cgi store or one of my other online stores like cubebrush and gumroad this is where you will also find the course files that go with this course so you can download them and follow along however for as little as 99p a month you could join the ant cgi club there are a few ways you can join you could head over to my patron or coffee pages or or alternatively simply hit that join button below this video in short the more support i get the more time i can dedicate to creating more high quality content just for you to get more information on how you can help follow the link on the screen or in the description below okay now that's out of the way let's get on with the video for this character we're going to give the animator both ik and fk controls but with the ik version we're going to use spline ik because we are now adding the fk option i decided to include some extra fk controls here that weren't in the previous video these are set up just like the other fk controls so we can animate them all to get some nice poses okay let's hide all the controls apart from the spine now we can also hide the main skeleton too so all we can see here are the control joints first let's organize the controls parent the shoulder control to the chest control and then the chest control to the lower spine control now parent the hip lower spine head neck and pelvis fk controls to the cog control so everything will move with the cog next let's clean up the values we can do this as we have been before by simply moving the values down to the offset parent matrix section and then resetting them or you can use the supplied script like i'm going to do to speed things up okay that's done so at the moment we are seeing both sets of controls ik and fk so let's update that so we only see the ones we need as we switch between ik and fk open the node editor and bring in the cog control what we're going to do is use the ik fk switch attribute to also show and hide the correct controls also bring in the pelvis fk control previously we used the ik fk switch attribute to drive the fk so let's connect that to the pelvis fk controls visibility attribute so you see the fk controls have gone now we also need the spine ik fk reverse node which we created in the previous video if you remember we use this to help blend between the ik and fk joints but we also use it to show and hide the controls let's bring that into the node editor too let's just organize this now bring the lower spine and hip controls into the node editor too now connect the output x attribute from the reverse node to the other controls visibility attributes okay now as we switch between ik and fk the correct controls are visible you don't really want the ik controls being used when the fk skeleton is active and vice versa let's wire up the fk controls first as they are easier to do all we need them to do is drive the control spine's fk joints back into the node editor let's clear this import the fk controls remove the shape nodes we now need the fk spine joints let's find them and bring them in and let's just organize these the fk controls have zero values which is exactly how we need them the joints however have an offset on them so connecting the controls directly wouldn't work because the translate y value here would be replaced with the zero value this would make the joint move position because these are the control joints and they're not driving the mesh directly we can again use the transform offset parent matrix attributes to help us again we can move the value from here down here and then set this back to zero so we now have clean values on the joints let's update the other spine joints now so move the values down here now we have the transforms zeroed out so they match the controls we can use a direct connection to drive them this is so much more efficient than using constraints or other nodes just go through and connect the controls rotate attribute to the fk joints rotate attribute and also connect the translate attributes too just to give a bit more flexibility i'll just work through the others you could also connect the scale attributes too if needed and this will scale those joints but i wouldn't recommend doing that just yet because we need the scale attributes to drive our stretchy limbs later in the course okay done so there we can now manipulate the fk spine with the controls and we didn't need to use constraints or other complex connections there's one more step we need to do before the fk spine is complete at the moment it works well but if we try to move the cog control nothing happens the problem with using direct connections is they rely on actual values being driven into them even though we move the control the pelvis fk control is still set to zero so the fk joints aren't being told to move so we need to approach the pelvis joint in a different way first select and delete the connection between it and the pelvis fk control instead connect the controls world space zero attribute to the pelvis fk joint's offset parent matrix attribute this is going to take the controls world position and use that to drive the joint instead so now the spine is tilting forwards a little just like we did with the main transform attributes we also need to zero out the joint orient down here great that's now corrected the spine and it's back in its original position and everything now moves with the cog control let's switch to ik now so here are the main controls let's collapse these in the outliner and find the control joints the first thing we need to do is create a series of control joints now these aren't the same as the control joints we created previously i know it sounds a little confusing and thinking back maybe i should call these different names but anyway so instead these joints will be what the controls drive because we don't want them to influence the spine joints directly duplicate the ik spine pelvis joint and move it out of the hierarchy let's hide the model for now we have three main controls here so we only need the joints that are in these areas so let's keep those and remove the ones we don't need and let's rename them so they have underscore control joint at the end again so we know what they are actually let's call this mid spine control joint and this upper spine control joint to make things clearer and get rid of this one let's change the radius so they are a little bit more obvious maybe four okay that's better what we need to do next is update the orientation of this joint so it matches the shoulder control as you can see it just needs to be back at the world orientation actually let's update the colour first we'll just make them green for now we also need to reset the pelvis control joint here too so it matches the control select them both and go to skeleton orient joint and open the options we just need this set to orient joint to world perfect apply that okay good orientations fixed we need them to match the controls so we don't get an offset when we connect them what we're going to do now is clean up the values again just like we did with the controls so we simply move the attributes here down to the offset parent matrix tab or use a script okay that's done and this one although did you spot that it moved slightly that's because we again have a value here on the joint orient attributes so we just need to zero that out to move it back just like we did with the spine you see the pelvis joint is already at zero so it didn't move okay reset the upper joint now now we want these controls to move the joints so back to the node editor bring in the main controls but instead of the pelvis control use a hip control instead using this will give us the ability to wiggle the hips now bring in the control joints and organize these okay so we are going to tackle this a little differently to the fk controls this time connect the world matrix 0 attributes on the controls to the offset parent matrix attributes on the joints we use this option because the joints aren't in a hierarchy so you will notice that the upper spine joint has moved away now which we don't want what has happened is that the shoulder control has got an offset applied to it already and this may be that i froze the transforms on it when i shouldn't have we can easily fix this though so if this happens to you just follow the following steps so let's undo that connection for now and let's find the control now move it out of the hierarchy so we get the true translation values in the channel box we need to remove the offset we added in the offset parent matrix tab in the attribute editor all we do is right-click and select set matrix to identity so what we should have now are values which are the distance from the world root if we reset them the control should move back to the grid ah you see there's an offset here it's not sat at the world route so it's this offset that's being passed to the joint when we connect it okay let's hold x and snap this back now we can freeze the transforms to reset it okay now reposition the control so it's back up with the control joint and move it back into the hierarchy so under the chest control what we have now is an exact offset from the world root relative to the parent nodes so we can clear this now we have the correct values again just moving the values down to the offset parent matrix tab now when we connect world matrix 0 to offset parent matrix it doesn't move perfect and the joint now follows the control there we go they all follow so that's the control setup now let's create the spline ik which they will drive at the heart of spline ik is a curve and the tool will create one for you automatically but i prefer to build my own just so i know exactly how it's constructed and what cvs i have to work with go to the create curve tools edit point curve tool and open the options we want this set to 3 cubic so we get a softer curve now holding v click next to each joint in the spine to create a series of points when done press enter to finish the curve and there it is our curve let's rename it to spine curve and go back now we have the curve we can create our spline ik handle go to skeleton create ik spline handle and open the options just reset this so these are the basic options we already have a curve so we can disable this we also don't want the curve parenting to the joints so we can disable this too now select the root joint and then the end joint and then finally the curve and there we have our ik spline handle just rename this so unlike normal ik you don't animate the main handle you deform the curve instead to control the joint's movement you see if i select a cv and move it the joints follow so we get a nicer more natural movement i'll bring back the control joints now and all we're going to do is bind them to the spine curve the default options are fine just use selected joints as the bind to option we can now use the controls to move the control joints which in turn are deforming the curve this curve is then now changing the shape of our main spine control joints let's bring back the model so we can see him deforming ah okay something's not right here ah so it seems i created the ik spline on the fk joints instead of the ik joints okay i've just gone back and rebuilt it using the right joint chain this time now we can adjust the controls and the spine deforms with them it may be that an area doesn't deform how you would like sort of like here where the head is tilting as the top of the body moves because we use the skin cluster on the curve we can edit the weight values to adjust how it deforms let's show the curve and select some of the upper cvs the top three may be now go to windows general editors component editor so we can see here under the smooth skins tab the weight values let's change them so they are fully weighted to the upper spine control joint so set these to one that's updated now so it's not perfect so needs more tweaking and adjusting but the shoulders are now more level we can now manipulate the shoulders but you will see nothing seems to happen if i twist them the same with the other controls we can rotate them so he bends back and forth we can also wiggle his hips but there is no twist registering let's update the scene a little so we can see what's going on so i'm just going to turn on wireframe and show the joints and let's also display the local rotational axes now you can see if we twist the lower and upper controls the spine joints aren't twisting with them if we look at the spline ik handle we have two attributes roll and twist if we adjust twist we get the movement we need in the upper spine if we just roll now the whole spine rotates which isn't ideal but it gives us something to work with okay let's go back to the node editor and wire these up so the controls activate these attributes and give us the twisting in the spine let's clear this and bring in the hip control also bring in the spline ik handle too let's open these so it looks like the rotate y attribute should make the spine twist so let's use that to drive the role attribute connect rotate y to roll now as we rotate it the spine moves with it great that's more how you would expect the spine control to affect the spine what would be better is if we could change this so it only affected the lower spine so then we could just control the upper spine with the shoulder control we basically need to twist the shoulders back so the role attribute doesn't appear to affect them so we can do this with the twist attribute we can take away the twist value from the role attribute value to cancel it out press tab and create a new multiply divide node and open it up this node will let you multiply or divide one value by another so we can use it with the twist attribute connect rotate y to input 1x so there we have the controls y rotation and it's currently being multiplied by a value of 1 which is the input to x attribute here if we change this to minus 1 what that's going to do is invert the rotation value so effectively making it a negative number now let's connect the result of that from output x into the twist attribute on the ik handle so now the upper spine is more stable because the twist attribute is taking away the rotation so pulling it back into position the hips look much better now they move independently of the rest of the spine let's quickly rename this before we lose track of what it does twist offset multi now we need to get the upper spine to twist with the shoulder control the problem is the twist attribute is now locked so we can't edit it if we connect the shoulder controls rotate y attribute to it it will break how the lower spine works so what we need to do is add the shoulder controls y rotation into the mix so we can do this with another node here add the shoulder control to the node editor remove this and open this so press tab and create a plus minus average node rename it to shoulder twist pma this node will take a series of values and add them together for us subtract them or find the average okay let me get organized first we need the current twist value so the one which is being taken away this is coming from the multiply divide node so connect output x to input 1d 0 on the plus minus average node we now want to add the shoulder rotation to this so take its rotate y attribute and connect it to input 1d1 where did you go there you are so with those now added together we can connect the output 1d from the plus minus average node to the twist attribute okay let's try this now the hips still work good the shoulders now twist two perfect okay so we have another problem the chest control we need that to also twist the upper body too well now we have this network set up we can easily add another control to it bring the chest control into the node editor and all we need to do is add that to the plus minus average node 2 so it's taking into account its rotations too so connect rotate y to input 1d2 there we go that works now and influences the upper torso let's test down here so it looks like we have a similar issue down here the lower spine control isn't twisting the spine now you may want it set up like this which is fine but i think we might add the functionality back in the good news is we can use the same setup as we did with the chest control and simply add the hip and lower spine rotations together let's move the hip control up here so we can add another plus minus average node here so let's create a new one we can just duplicate this one actually open it up and rename it to hip twist pma connect the hip controls rotate y attribute to input 1d0 let's remove some of these and bring the lower spine control in ah okay looks like i accidentally called this root twist multi when i was reorganizing the scene it should actually be the hip twist pma node sorry about that i'll make sure it's corrected in the source files so just make sure you're connecting to the hip twist pma node not the root twist multinode so now connect the lower spines rotate y attribute to the input 1d1 attribute on the plus minus average node now connect output 1d to the role attribute on the ik handle we can now use that to control the lower torso and the hips still work too upper spine works great okay let's reset these and test them properly so we can move his torso control the hips independently and also pose the spine the beauty of this being a spline ik based spine is we can also pull it around too using the transform attributes don't forget we also have the fk controls for more flexibility let's reset everything so that's the main spine rig completed before we move on though we need to do some more tests and this time we need to see how it works with the route control it's always worth testing things like this as you go just so you can eliminate potential issues early on so it looks stable enough so far let's move those control joints into the spine group ah you see as we rotate the upper body is moving away from the rig let's move the curve and ik handle into the spine group too first i'm going to unlock the curve because if the translations change it will jump off the rig okay that looks worse now let's undo so everything moves back out of the spine group the problem is the pivot for the spine group is here around his core ideally we need it to be back at the world root so everything pivots with the root control create a new group call this spine group we can see the pivot is in the right place this time let's move everything into this new group and delete the old one now move the new spine group to the rig systems folder and parent all the other spine elements to the spine group let's try the root rotation again okay much better so they are now pivoting around the root controls pivot so the spine is staying in position okay it seems we have another problem now the spine isn't twisting with the root control if we bring back the skeleton you can see the spine joints have separated here what we need to do is add the root controls rotate y attribute into the same network we used for the lower spine and hip controls so it effectively adds to the ik handle's rule value let's go back into the node editor and find the hip twist plus minus average node all we need to do is connect rotate y from the root control to input 1d3 adding another value to the node you'll see now the spine has snapped into place and if we test it you can see it's moving with the root control now okay so a bit of a longer video this time but we had a lot to cover we now have a working spine rig with both ik and fk functionality okay what should we look at next i think what we might do is we'll move up and work on the neck head and eye controls so i will see you in the next video okay that's another video over thanks for watching right to the end and make sure you also check out some of the other free videos and courses that i have available you can find links to all these on the screen now and in the description below remember to help support future content and keep these videos free visit the ant cgi store or join the ant cgi club alternatively if you would just like to show your appreciation for these videos why not treat me to a coffee at my coffee page again the link is on the screen now and in the description below thanks again for watching this is ant cgi signing off and i will see you on the next one you
Info
Channel: antCGi
Views: 888
Rating: undefined out of 5
Keywords: rigging, maya, autodesk, maya3d, rigging in maya, utility nodes, rig, node editor, nodes, Build Controls, 2019, Spine, Head, Pelvis, Waist, Abdomen, Sternum, Shoulders, gamedev, game art, game development, game rig, 2022, maya 2022, offsetParentMatrix, spline ik, fk, ik, spline, component editor, transform offset parent matrix, spine fk
Id: XYNHhOOWGzE
Channel Id: undefined
Length: 33min 5sec (1985 seconds)
Published: Fri Dec 03 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.