Creating Custom Control Rigs in Maya

Started by ABloodyCanadian, March 14, 2015, 06:52:50 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

March 14, 2015, 06:52:50 AM Last Edit: March 25, 2015, 07:38:20 AM by A Bloody Canadian
Creating Custom Rigs in Maya

To those of you who Animate in Maya as opposed to BrawlBox, you pro'lly appreciate the magic that such a software provides. The Graph Editor, IK Handles, Control Rigs, and so much more! Tho, if you're somebody like me, I just dislike working with the HumanIK Control Rig that Maya provides. My problem with it is that there are 2 controls for each foot, and that parts of a limb you move and keyframe will keyframe all the controls relating to it. As somebody that likes to work with the graph editor, this annoys me, and would rather work with a custom Control Rig that doesn't have these issues. And I'm willing to share this knowledge to you! Bear with me cause this is actually quite a long Tutorial. Knowledge on how to work with Maya is recommended!

IK vs FK
Sorry but you are not allowed to view spoiler contents.


Before we start...
Sorry but you are not allowed to view spoiler contents.


Another thing to note when working with your model is that the bones you'll be making IK handles for should have a slight bend to them in the correct direction. This is a way to tell Maya the default direction to bend. You may end up having to translate some of these bones if that's not the case (1 of the 3 Translate Values should be set to 0 unless you want the limb to bend diagonally), and the bones might as well be re-skinned to make a better looking bone rig.

Creating IK Legs
Sorry but you are not allowed to view spoiler contents.


The 1st thing we should do, since this will be used for a later part is create a 3rd foot bone that's parented to the Toe Bone. Be sure that all the values for both toe bones are the same.

Sorry but you are not allowed to view spoiler contents.


Now, we can start making our IK Handles. Click on Skeleton>IK Handle Tool [Option Box]. And make sure that the Current Solver is set to Rotate-Plane Solver.

Sorry but you are not allowed to view spoiler contents.


Open the Outliner, and with the IK Handle Tool, click on the Leg bone, then Ctrl+Click on the Foot bone. This will create an IK handle between the leg, through the knee, and ends at the foot.

Sorry but you are not allowed to view spoiler contents.


Open the [Options Box] for the IK Handle Tool again, and set it to Single-Chain Solver. Create some more IK Handles. One between the Foot and the Toe Bones, and another one between the Toe, and the new bone you created.

Sorry but you are not allowed to view spoiler contents.


Next, you can either create a NURBS Circle by going to Create>NURBS Primitives>Circle, or use Create>CV Curve Tool to create your own shape. If you do use the CV Curve Tool, make your shape assuming that the pivot point is at the center of the grid. You can make points snap at the grid by holding X as you create it. Like the IK Handles, rename your curves accordingly.

Sorry but you are not allowed to view spoiler contents.


After creating, and shaping your curve, place it under the foot, and make sure it's big enough for you to click on. You'll be using this curve to move the foot around as opposed to clicking on the bone itself.

Sorry but you are not allowed to view spoiler contents.


After that, select both curves, and do a Modify>Freeze Transformation and an Edit>Delete by Type>History. This will zero out the values of the curves, and will make it clean from any history the curve may have had, making your computer store less info. We wanna do this since we wanna be able to easily restore them to a default position.

Sorry but you are not allowed to view spoiler contents.


Next, you wanna select all your IK handles in the Outliner, and Middle Click Drag them to the Control Curve in the Outliner. By doing that, you are parenting the IK handles to the Control Curve. If you've been making IK handles for the other leg at this point, put the correct IK handles into the right Control Curve based on which foot it's for. This is why we rename everything!

Sorry but you are not allowed to view spoiler contents.


If you move around the Control Curve, you'll see that the foot will move as you move it. And the legs will change their orientation based on the position of the foot, and the hips. You can also keyframe it as it was bone, which is also neat. But despite all this, we are only about halfway done! As of right now, we have no way to animate the toes, and we don't have a say as to how the knee is oriented.

Sorry but you are not allowed to view spoiler contents.


Let's knock out the easy one first. Creating a knee Control. Use either the NURBS Circle, or use the CV Curve Tool to create your controller. This time however, we're going to place it infront of the knee. Like last time, when you're done shaping and positioning the curve, Ctrl+D for the other knee, Freeze Transformations, and Delete History.

Sorry but you are not allowed to view spoiler contents.


In the Outliner, select the curve you just created, then Ctrl+Click on the Foot IK; the first one we made. Then pick on Constrain>Pole Vector.

Sorry but you are not allowed to view spoiler contents.


How this controller works is that if the legs are bent, the knee will be pointing at the direction this controller is. Moved it to the left? The knee will follow.

Sorry but you are not allowed to view spoiler contents.


Now for more robust Foot controls, and here's the reason why I love these custom rigs so much. What we're gonna do now is create custom attributes in the Channel Box that will allow us to rotate the the feet and toes in very specific ways. For this tutorial, we're gonna create 6 of these custom attributes. Feel free to add in more when you feel the need to.

Select the LegIK (Leg to Foot) and FootIK (Foot to Toe) with Ctrl Click in the Outliner, and press Ctrl+G to group them. Rename them accordingly.

Sorry but you are not allowed to view spoiler contents.


Press the Insert Key with the group selected to change the pivot point of the group, so it can rotate the way we want to as opposed to having it rotate on the origin. We are going to vertex snap this pivot point to the Toe bone by holding V and Middle Clicking it. Press Insert again to exit Pivot Edit mode.

Sorry but you are not allowed to view spoiler contents.


This will be our Foot Roll attribute which allows us to Peel the Heel off the ground without having the toes leave off as well. Already, you might appreciate why I like these rigs so much! It's so much easier to manage than to use 2 Controllers which is more of a hassle to me than anything. As of right now however, it's still not yet an Attribute in the Channel Box, but we'll get to that eventually. Right now, we need to create more groups like these based on how the foot will rotate.

Sorry but you are not allowed to view spoiler contents.


Select the ToeIK (Toe to New Bone) in the Outliner, and Press Ctrl+G. Like last time, we're gonna edit the group's Pivot Point to the Toe Bone. This will be our Toe Tap, which will allow us to rotate the toes without having to move the rest of the foot.

Sorry but you are not allowed to view spoiler contents.


The rest of the controls will have us create groups to rotate the entire foot. So for the next group, select both groups we created, and press Ctrl+G. The following ones will have us create a group comprising of this group we created. A Group within a group. Group-ception! For the sake of this tutorial, I'll give out the names of these attributes, and match them with their corresponding Pivot Point Locations.

---Heel: The edge of the character's heel at Ground Level.
---Tip Toe: The very tip of the character's toes at Ground Level.
---Heel Pivot: The Heel Bone at Ground Level.
---Toe Pivot: The midway point between the Toe Bone and the New Bone at Ground Level.


Sorry but you are not allowed to view spoiler contents.


Now to actually turn the groups into Attributes in the Channel Box! Select the foot curve you wanna add the attributes to, and then on the Channel Box, go to Edit>Add Attribute.

Sorry but you are not allowed to view spoiler contents.


Where it says Long name, we're gonna give out the names of the Attibutes we've made. You can either type them out normally, or make spaces by typing in capitals like "FootRoll" for example. Click add for every Attribute we're making, and close it when we're done.

Sorry but you are not allowed to view spoiler contents.


Now, you see that our curve now has custom attributes. But as of right now, they do nothing. We haven't told the Attributes what they'll be doing. This is the final part to finishing the Leg IK Controls!

Sorry but you are not allowed to view spoiler contents.


Go to Window>General Editors>Connection Editor. When you open it up, you'll see 2 charts side by side. It's kinda hard to explain, but basically what we're doing here is telling Maya to make the Attributes of this curve work with the groups we just made. Connecting 2 things together so to speak. Go to the Left Display>Show Non-Keyable. By unchecking this, we hide all the useless stuff, and makes the charts less overwhelming to look at. Do the same for the Right Display while you're at it.

Sorry but you are not allowed to view spoiler contents.


Select the Foot Curve, and Reload Left. Then click on the Attribute you want to connect first in the Connection Editor. Then click on the corresponding Group in the Outliner, and Reload Right.

Sorry but you are not allowed to view spoiler contents.


On the right side, navigate yourself until you find RotationX. Clicking on it will successfully connect the Attribute with the X Rotation of the group.

Sorry but you are not allowed to view spoiler contents.


Repeat this process for all the Attributes and Groups. Selecting the Attribute on the left, and reloading the group on the right. Do note that for the Heel Pivot Group and Toe Pivot Group, you'll want to select RotationY instead.

Sorry but you are not allowed to view spoiler contents.


Now you have finished making a complete IK Leg Control Rig! Play around with it to your liking! All that's left is to do the same for the other leg.

Sorry but you are not allowed to view spoiler contents.



Creating FK Controls
Sorry but you are not allowed to view spoiler contents.


Press Ctrl+G to Group itself, and Rename it Accordingly.

Sorry but you are not allowed to view spoiler contents.


With the Group still selected, find the bone you want the curve to apply to in the Outliner, Ctrl Click on it, and press the P Key to parent it.

Sorry but you are not allowed to view spoiler contents.


Go to the channel Box, an press 0 to all the of the Groups Translation and Rotation Values.

Sorry but you are not allowed to view spoiler contents.


Select the group in the Outliner, and press Shift+P to unparent the group from the Bone Tree. You'll find it at the bottom of the list.

Sorry but you are not allowed to view spoiler contents.


The group now has these random Values to it. Leave them alone and never mess with it, for this is used to get the Control to it's correct position while still keeping the curve itself at a 0 Value. At this point, you can rotate the curve itself to the way you want it. Then Freeze Transformation and Delete History.

Sorry but you are not allowed to view spoiler contents.


Open the Connection Editor, select the curve, and Reload Left. Then Select the bone you want the curve to apply to, and Reload Right. Click on Translation for Both sides, then click Rotation for both sides, and there you have it! A working FK Control! Do the same with every other bone you want to add FK Controls to.

Sorry but you are not allowed to view spoiler contents.


Because of how parenting works, if we were to make FK Controls from the Hip, to the Head, it would be best if we parented these Curves and Groups respectively. Something that you may notice happening is that if you translate the Hip bone, the controls relating to said bone won't follow. So what you wanna do is parent the child group to the parent curve. In the end, it should look something like this...

Sorry but you are not allowed to view spoiler contents.



Creating IK Arms
Sorry but you are not allowed to view spoiler contents.


Move it so it's behind the ShoulderJ Bone. You can Vertex Snap to it by holding V and Middle Clicking, and then pulling it back. To make the rig easier to work with, you may want to press Insert so you can Vertex Snap the Pivot Point to the ShoulderJ Bone. Once you're done with that, make a duplicate for the other side, Freeze the Transformations, and Delete the History.

Sorry but you are not allowed to view spoiler contents.


Select the Curve, then Ctrl Click the ShoulderN bone in the Outliner. Then go to Constrain>Aim [Options Box]. And make sure you match these settings in the following image...

Sorry but you are not allowed to view spoiler contents.


You're now able to orient the ShoulderN Bone however you please! But we still have a straight arm, so let's get to that. Take out the IK Handle Tool, and set the Current Solver to Rotate-Plane Solver, and in the Outliner, select the ShoulderJ Bone, and Ctrl Click the HandN Bone. Rename the IK Handle and the Effector in the Bone Tree.

Sorry but you are not allowed to view spoiler contents.


Create another NURBS Curve, or use the CV Curve Tool again to make our shape. To get this control to it's proper position, we'll be using the method mentioned in the FK Section. Only difference is that we won't be using the Connection Editor to connect the controller with the bone.

Sorry but you are not allowed to view spoiler contents.


Instead, what we wanna do is select the Curve, Ctrl Click on the IK Handle in the Outliner, then go to Constrain>Point. Now, as we move the controller around, the arms will bend accordingly.

Sorry but you are not allowed to view spoiler contents.


However, this will also rotate the hand as well. We want full control of our hand Orientation too, so to fix this problem, select the Curve again, then Ctrl Click on the HandN Bone. Then go to Constrain>Orient. Now we have Full control of the Hand!

Sorry but you are not allowed to view spoiler contents.


Much like how the Knee is on the IK Legs, we'll need a Pole Vector to get an Elbow orientation. Repeat those steps with another NURBS Circle/CV Curve with the Hand IK. Be sure to have your curve behind the elbow when you place it, and duplicate one for the other side.

Sorry but you are not allowed to view spoiler contents.


Last step! This step actually involves those who appreciate the human anatomy, and have a properly rigged ArmNa Bone. If you're not one of those people, then by all means, skip this step. If you are, please follow along.

Go to Window>Animation Editors>Expression Editor. In the Expression Box, type in the following, then click create...

  ArmNa.rotateX = HandN.rotateX / 2;

Of course, do take this code into account of the Left and Right Hands since this code calls for specific names. It is also Case Sensitive, so keep that in mind. What this does is make the ArmNa Bone's Rotation X value equal to half the HandN Bone's Rotation X Value. As a result, it will make arm rotations more closer to real arms on an actual person, and reduces your chances of overtwisted wrists.

Sorry but you are not allowed to view spoiler contents.


And there you have it! IK Arms ready for action! If you're wondering about the fingers, I'd say they're probably better off as FK Controls. So get that done, do the same for the other arm, and you should be good!

As an optional step, you may want to parent all your Arm Controllers and IKs to the Bust FK Control if you have one. Although, if you plan on adding FK Controls to your arms, you may want to disregard this step.

Sorry but you are not allowed to view spoiler contents.


Adding FK Controls to IK Limbs
Sorry but you are not allowed to view spoiler contents.


We'll use the FK Method for the ShoulderJ, ArmN and HandN bones. Instead of using the Connection Editor however, we'll select the curve, then Ctrl Select the bone on the Outliner. Then go to Constrain>Orient. Then parent each controller accordingly in the Graph Editor.

Sorry but you are not allowed to view spoiler contents.


Now we have what should be working FK Controls, but there is one problem... The IK Controls are still active! We need to be able to seamlessly switch between IK and FK so one of each will be active at a time! To control that, we are gonna create a new Controller, and add 2 custom Attributes to it. IK, and FK.

Sorry but you are not allowed to view spoiler contents.


We're gonna use the Connection Editor to apply these Attributes to a couple of things that will not only act as the "switch" between the 2 Controls, but also make the controls easier to manage! Load up the Switch Controller on the left, and the ArmIK on the Right. On the right, click on IK, and on the left, click IKBlend.

Sorry but you are not allowed to view spoiler contents.


Find the Orient Constraint in the Bone Tree (Should be parented to the hand bone), and reload Right. You'll see 2 Attributes of a similar name. Click on the 1st one.

Sorry but you are not allowed to view spoiler contents.


And lastly, Select the Group that has all the IK Controls and Reload Right. Click on it's visibility.

Sorry but you are not allowed to view spoiler contents.


Now for the FK Controls. First, we`ll deal with the Visibility of the Group that houses the Arms FK Controls.

Sorry but you are not allowed to view spoiler contents.


Then you'll wanna go to the constrains of every FK Handle found in the Bone Tree, and find the Attribute that end with W0.

Sorry but you are not allowed to view spoiler contents.


Now we can simply set these IK and FK Custom Attributes On and Off whenever we like! But don't you think it's inconvenient to turn them on and off one at a time? This last step will make it so that when we turn off one, we'll turn on the other. Open the Expression Editor, and type in this code.

  ArmIKFKSwitch.FK = 1 - ArmIKFKSwitch.IK;

Of course, this is assuming you've named your switches exactly the way I did. Like last time, take note of which side you're doing as well for this calls for specific names.

Sorry but you are not allowed to view spoiler contents.


That's essentially it! You now have Arms that can work both IK, and FK at will! And like the Custom Attributes on the foot, you can keyframe these as well. Because this is a Boolean attribute however, the default Tangents will come as stepped tangents which is essentially Mr.G&W Animations. You can however select your keys, and make it an Auto Tangent instead, making transitions between IK and FK alot smoother.

If you wanna do the same for legs, it's essentially the same steps. Granted, there are a few differences because of the way we did it. I'll have to experiment with it myself.

I hope this is of use to you guys! Do feel free to address anything if you have problems cause I can guarantee, you will. I even had problems Re-Rigging this model for this tutorial. Bones start rotating when parenting IK Handles to Curves, some IKs don't bend properly... idk what more there is but to be honest, these problems probably wouldn't occur if the bone structure for these models weren't so weird. Her Right Leg's Default Rotation has it's X Rotation set to 180 Degrees for crying out loud! Same with the Right ShoulderN Bone! Geez... My solution to this would be to delete your controllers of that joint, fix the bone rotations, and start again. It should work the second time around.

As far as Baking goes, it's not much different from the tutorial I linked back at the start of this tutorial. Select the entire Bone Tree, Deselect any Effectors in it, as well as the extra toe bones, bake, then Export the Selection as an .anim file. That's pretty much all there is to it.

Better post here before this thread dies. :x

I'm having a bit of an issue with the leg stuff. I can figure it out just fine, but there's two issues.

-When I apply the IK Handle for the leg, the toe dips into the ground. Is this because I imported the model with a pose, rather than the T-Pose?
-When I make a Group, the Group appears at the center of the scene, rather than the foot.

I really hope more people (including myself) will catch onto this. It's a shame to see this thread go ignored. :c
I don't take requests.

My PSA Thread
[move][/move]

March 23, 2015, 08:48:02 AM #2 Last Edit: March 23, 2015, 08:56:22 AM by A Bloody Canadian
1). It would be preferred that you make custom rigs on a T-Posed Model. Not entirely sure what were to happen otherwise... From my experience, this has never happened to me.

2). The creation of a group will always be at the Origin (0,0,0). They won't appear at the foot. This is why we press Insert, and move that pivot point to the desired location by either moving it manually, or Vertex Snapping to a Bone. Pro'lly should have elaborated on that a bit, huh?

This thread pro'lly goes by unnoticed cause out of all the A/A Hackers here, who actually uses Maya to animate? Pretty sure a majority of those people still use BrawlBox, and do not yet appreciate everything Maya has to offer.

Just a bit of an update, I've recently made a breakthrough as to how to make an IK/FK Hybrid Limb. Still trying to figure out how to make it neat tho... lol...

March 25, 2015, 08:13:42 PM #3 Last Edit: March 25, 2015, 08:19:25 PM by KingJigglypuff
I'm having another issue as well...

When I apply the IK Handle for the right leg, the leg turns around by 180 degrees. What do I do to fix that? I tried rotating the IK Handle by 180, but that did nothing. Do I have to rotate the actual bone by 180?
I don't take requests.

My PSA Thread
[move][/move]

March 25, 2015, 11:29:31 PM #4 Last Edit: March 25, 2015, 11:32:41 PM by A Bloody Canadian
This is because of how the rotation Value of the Right sided limbs are default to 180.

I had a similar problem with the right leg, only it was rotated 45 Degress on the Y Axis when I applied the IK Handle to the Curve.

When I did the legs, I did it in this order...

1). Apply IK Handles to the Bones
2). Created NURBS Circle/Used CV Curve Tool
3). Position, and apply a Freeze transformation and Deleted the History of the Curve
4). Parented the IK Handles to the Curve <- This is when the leg rotated on me.

I don't know exactly what you did, but as stated before, deleting the curves and handles, re-orienting the bones to their proper place, and starting over worked for me when rigging the second time around. I tend to never mess with the IK Handles after creating and renaming them, and only went back to them when working with Custom Attributes.

Probably doesn't help that I'm still experimenting with this rig even now. Any breakthroughs with it I'll most likely update the tutorial when needed.

It happens when applying the IK Handles to the bones.

I tried deleting them, rotating them, then trying again, but that doesn't work either.
I don't take requests.

My PSA Thread
[move][/move]

Then you have encountered a situation I've never been in... lol...

Ah... idk how different your bone structure is. Idk how to solve it either... Perhaps a look at your maya file would help?

March 31, 2015, 04:41:29 PM #7 Last Edit: March 31, 2015, 04:52:52 PM by KingJigglypuff
For the Heel Pivot Points section, what do I do if my character's heels are a bit above the floor? I can take a screencap of my character if need be.

Could we also see example images of how the final 4 Pivot points should look for the legs?
I don't take requests.

My PSA Thread
[move][/move]

The model I used had her toes slightly off the floor. I wouldn't bother with it so much considering it's for Brawl Mods. But if it bothers you that much, that should be an issue that should be dealt with before you start rigging... lol...

As far as the Foot Pivots go...

Heel
Sorry but you are not allowed to view spoiler contents.


Tip Toe
Sorry but you are not allowed to view spoiler contents.


"Heet"Pivot
Sorry but you are not allowed to view spoiler contents.


Toe Pivot
Sorry but you are not allowed to view spoiler contents.


Just think of the way you wanna move the characters feet. I just listed some of the basic ones.

Yes, my character is being used for Brawl.

As for the heel placement, it's very high. (I don't know the scientific description of an organism that walks on its toes.)
Sorry but you are not allowed to view spoiler contents.

Does the pivot point have to be on the floor?
I don't take requests.

My PSA Thread
[move][/move]

For a Heel Control, I'd put it where the ball of the foot is, when the foot just inclines up to the heel. That's also where I'd put my heel pivot.

When making these custom pivot attributes, you gotta think how the feet work, and how would you wanna move it? Create the group, set the pivot point to the point where the foot will rotate, and attribute it with it's Rotation Axis.

Alright. Thanks for the input. Sorry for making this into a troubleshooting thread. :x
I don't take requests.

My PSA Thread
[move][/move]

I pro'lly should have finished my Rigging Class before I made this tutorial... lol... Prepare for this tutorial to be rewritten in the next few weeks.

[Vigorously waits]

What things did you learn since then?
I don't take requests.

My PSA Thread
[move][/move]

Constraints; VERY IMPORTANT. As well as a few answers as to why your IKs are bugging out... lol...

I apologize for wasting your time... lol...