Join George Maestri for an in-depth discussion in this video Wiring up the FK/IK switch, part of 3ds Max: Character Rigging.
Now we have our control rigs in place, and we can start wiring up our FK, IK switch. Now before we do that, we need to figure out, where do we want to put the switch? Some people put it the wrist. I want to put it at the hands. So I've created a hand controller here, and it's really just a basic rectangle. So, I need to get this setup and then we can put in the IK, FK switch. Now, before I do anything, I want to turn off a layer here, I am going to turn off this control skeleton layer, so that way we don't get confused and we are not going to need to see those bones for the rest of this lesson.
So, let's go ahead and turn those off. And then under this rectangle we need to give it a descriptive name. So, I'm going to call it Ctrl_left hand. And then let's give it a color that resembles blue. Now, we need to align the pivot. So, I'm going to go into hierarchy. Affect pivot only, and we're going to align that to the wrist bone. When I do that I want to make sure I'm aligning position and orientation. And then if I want I can select affect object, and then move this around to position it the way I want.
So now that I have everything positioned, I've got a hand control with a pivot at the wrist. Now, this will be important later when we wire up the hand, but right now we're just focusing on FK and IK. So, before we do anything, I want to go ahead and give myself a little bit of difference between my FK and IK chain. So, I am going to set a key for my IK handle here, and then move forward in my timeline and just move that over just a bit, so that way I have a second position. And we can just make sure we have a key for that.
So now you can see that because this is half way between my IK and my FK solution, I'll have a little bit of a visual reference for when I start to wire this up. When we hook this up we're going to use an attribute holder along with wire parameters. So, let's do that. I'm going to select my hand control. And let's add in an attribute holder. We can do that in the modifier panel, so I go to my modifier list here, and scroll down just a bit till we find attribute holder. Now this is just a blank node, that holds attributes that we create. So we can create those using the parameter editor. So then we can select that, and then we can add in whatever type of attribute we want. Now down here it shows us what it's going to look like, and all of these controls really control how that appears. So, one of the first things we can do is we can give it a name. So, we can give it a name. Let's call it. IK, FK, switch. And then we can determine what type of parameter. We're going to leave this at float. UI type, spinner or slider, and you can actually made this into a slider or a spinner. And we'll leave it at spinner so we can see the numbers. And then all sorts of options for where in the UI this appears. So I'm going to leave it mostly defaults, just change the name, and hit add. So now you can see, I get this custom attribute in my attribute holder. View, and I'm going to turn off auto key. So you can see that I can turn this up or down.
And now I want to wire the constraints on these arms to this switch. So, we can do that using wire parameters. So I'm going to go ahead and zoom out, and move over just a little bit, so we'll have room to see how this works. And we go into > Animation > Wire Parameters > Wire Parameters. Now the hot key for this is Ctrl+5. Now when we do this, it basically takes a selected object, and it asks you what parameter do you want to wire.
Well in this case we're going to wire orientation so we'll go into > Rotation > Orientation Constraint. And I have two weights here. Weight zero is FK or forward kinematics and that's the first one we selected. The second one is IK. I'm actually going to start with IK. So I'm going to select orientation weight one. And then it asks you were do you want to wire it. Well, we want to wire it to the hand control. And now it brings up my parameter wiring dialogue. Now, sometimes I have to select that hand control and refresh it here, and that's what I'm going to do now.
So I'm going to refresh it. So now, it's knowing I'm wiring the hand to my forearm orientation wave. But what is it that I'm wearing on my hand? Well I've got my modified object and my attribute holder that I just created. And under custom attributes, we have IKFK switch. So I want this to drive this. So I'm going to go ahead and make it a one way connection this way. And then I'm just going to leave it at the standard expression or the standard value. So this means when this is at zero IK is at zero.
When its at a hundred IK is at a hundred, which is what I want. So lets go ahead and hit connect. And right now it's at zero and when I bring it all the way up. It's at a hundred. So now I've got part of my IKFK switch in place. So let's go back into parameter wiring, and I'm going to select my forum, hit Ctrl+5. And this time we're going to wire weight zero. And again, I need to refresh this. So my IKFK switch is going to control weight zero.
But in this case I want this control to be opposite. So when IK is a hundred, I want FK to be zero. So I need to add a little bit of grade school math into this. And I need to say 100 minus this variable. So again when this is at zero. That means a hundred minus zero is a hundred, and so that means FK will be one hundred percent when this is zero and when this is at a hundred, well a hundred minus a hundred is zero so now FK will be zero.
So let's set our direction. Connect and now that should work. so now I've got my IKFK switch, you can see how it works and in fact if I go into my layers and I reveal that control skeleton, you can see how that is basically going from one to the other. Now we can do this again for the bicep. Now remember when I move this control skeleton, the bicep isn't moving completely with it. So when I take this IKFK switch it's not doing the bicep yet.
So let's go ahead, select the bicep, Ctrl+5 for wire parameters. FK sub control rotation orientation constraint, start again with weight one, wiring it to this, going to have to refresh this, so IKFK switch to weight one. On the bicep, connect, and now we can just stay in this window. Go to wait zero, and we're going to do a hundred minus and that's for FK, remember zero is our FK control, and update.
And there we go. So now, this should work all the way. So it goes between the two. And now we have a very good IKFK switch. So I'm actually going to go ahead and go back into my layers, hide my control skeleton. And let's go back to zero. So that everything is aligned here. And then I'm going to select my wrist and let's go ahead and delete those keys there. Now the one thing that's not happening is that the switch itself, or the hand control, is not moving with the wrist. And we can certainly change that, just by adding in a constraint.
So I'm going to select my hand control. Do animation constraints. Position constraint, and I'm going to constrain that to the wrist. Now, I only want to constrain position, because later I'm going to use this control to control the orientation of the hand. So now when I do this, the hand control basically goes with the wrist. It doesn't orient with the wrist, but at least it goes with it. So now, let's go ahead and rewind our animation. Make sure, everything is back at zero. I am going to go ahead and select my rest of IK controls and delete that animation.
So now, we have a clean rig. Now there's one more step we want to do and that's to make the controls appear and disappear depending on whether we're in IK or FK mode. And we'll do that one, next.
- Setting up layers
- Drawing and positioning bones in the skeleton
- Rigging foot controls
- Creating hip and spine controls
- Setting up IK and FK skeleton controls
- Wiring the IK/FK switch
- Rigging hands
- Skinning characters
- Setting up single- and multiple-axis face controls