Important Notice:

On July 31st, 2017 the Digital-Tutors library will be retired along with Digital-Tutors concurrent licensing. Effective August 1, 2017 any active group plans will be redirected to www.pluralsight.com. Each group plan will receive one individual user license on Pluralsight for each active Digital-Tutors license. Please contact your account representative for any additional questions.
Rigging the robot's left leg
Delano Athias

Pluralsight

Delano Athias
Let's continue rigging our robot's leg. So at this point we can reorient each of our leg joints. So I'll show you the manual way, and then we'll use a script to get it done a little bit faster. All right. So the first thing we'd want to do is select each of these. And go ahead and show their local rotation axes. So we can do that under the display menu, transform display, local rotation axes. I'd recommend adding it to your shelf, so let's go ahead and do that. Simply hold down CTRL-Shift, and click the tool. All right, So we can go ahead and turn those on. If you can't see them, just head over to your show menu. Make sure you have handles on. All right, so at this point we can decide the orientation we'll use. I'll just work with the default XYZ that comes default with the joint tool. All right. So with that said we can reorient them using our aim constraint tool. Making sure that the settings reflect the behavior of our joint tool again by default. All right, so what we'd want to do is first select our target joint. The joint that we'd like to aim at. So that's going to be the knee. And then we would grab the source joint, the joint to change. So at this point we can head over to constrain, aim. Go into our options, I will reset the settings. And just go ahead and choose add. So you can see now the x is going to point down to the knee as it should. So what we'd want to do from here is get rid of the aim constraint. I'll just go to the outliner for that. And now selecting our joint that has been reoriented, we now need to make sure that the joint has been oriented properly while leaving our rotation clean. We want to make sure our rotation is as clean as possible. So when this rig is to be baked down, if you decided to take that route, it's a lot easier to read animation in your graph editor. All right so to have that happen we want to transfer these values from the rotate channels to our joint orient channels. More importantly, we'd want to first make sure our joint orient channels are zeroed out. So the joint gets reoriented properly. So I have a script that we can use to get this done just at the click of a button. Then we'll take a look at another script to not only reorient the joint, but then it'll go in and swap our values and clean up our rotation. So let's head over to our script editor. And we can go ahead and clear our history. I'd also recommend under the history menu to go ahead and turn on line numbers and errors. So just in case as you're building your scripts if you encounter a problem we know exactly where it is happening. All right? So now we can go ahead and head over to File. Choose Load Script. Again, we'll go to our scripts folder. And we're going to want to load in the Zero Joint Orientation tool. So we'll go ahead and choose Open. So just to read the code, what it does. We first grab our selection. And if you notice, I'm using a different variable for the selection here as opposed to what we used before and what we will use. It's a good idea to use variables that are unique, even if it's the same command, this is just so you can keep track of what this variable does as opposed to another. All right? So JNT is going to find our selection, and then following that, we find any aim constraints that are tied to the object. We did have one at one point, but it has been removed. And if there any aim constraints it will go in and delete the aim constraint. And then following that it will transfer the values from our rotate channels to our joint orient channels. So what we find here, at the top, is our getAttr command. To grab the value of our rotate channels. So you can see the get adder of our selection will find our rotate X, Y, and Z. And then we use setAttr to set the joint orient attribute. OK? Set our joint orient attributes to the getAttr variables. So X, Y, and Z. And then, lastly, the code will go ahead and 0 out our rotate attributes. So since we already deleted the aim constraint on this you may get a warning that just says it's looking for an aim constraint. But this code will still work. So I'll go ahead and highlight everything, and add it to the shelf. We can go ahead and rename this to 0 joint tool. The tool tip. You can always use the same name as the tool if you like it. Or you'd like to get more descriptive you most certainly can. Now go ahead and rename the icon to ZJT. Save all shelves. All right, so let's go ahead and take a look at this. With the joint selected that we've reoriented, if we were to go ahead and run our tool you'll see that the joint has now been oriented to point at the knee. You'll also see that its rotation has been cleaned up. Those values have been transferred to our joint orient channels. All right, great. So before we finish off it's a good idea to just clean up the orientation a little bit more, which we may need to do. So in this case we do need to do that. Just need to have Y point forward, and follow the angle of the thigh. Just so that when we start to animate the leg it's, again, a lot more convenient. Our preferred angle is exactly the way we it to be. All right? So what I'll do here is go back to the attribute editor. Now just ahead and hold down CTRL over the X channel, joint orient X, and start to twist that so that Y is pointed forward. So in my case it's about a value of 67 or so. That'll work fine. All right, so that's one joint down. Let me go ahead and show you how we can get this done a little bit faster. Let's head over to our script editor again, and we'll go ahead and load in a new script. So the next one we want to find this one is going to, again, reorient the joint and clean up its rotation. It's [? ORY, ?] JNT, XYZ. So let's go ahead and choose Open. So just to read this back what we do is use what we call a procedure. And here's the procedure's name here. We're going to tie that to a window, which we'll see at the bottom of the code. But we get our selection, and then we check our selection. We need to have two objects selected. If we don't have two joints selected we'll get a warning. And then following that we first make sure that the joint is oriented to the world. All right? So we set our rotation and joint orient attributes to 0. That's what the first part of this code does. This is so that the joint will reorient properly when we use the aim constraint command, which is what follows next. So here's our aim constraint. All righty? And then following that we use the less relatives command to find the aim constraint on the second selection. Which is our source joint that we'd like to reorient. And then we delete it. And then following that we go through and we swap our values as we've done before. So we use the getAttr command as we saw before. Then we replace that and add that to our joint orient channels, and then 0 out our rotation. And then following this we just create a window at the end just to have something that pops up. So we can use that to run the tool. So there's our window command, here's the name of the window, and we make it adjustable, and here are instructions. First, select the target joint to aim at. Then the source joint. Then we create a separator just to organize things a little bit more in the window. We create two buttons. One to apply the tool. Here's our procedure that we saw at the top. So once we click Apply this is the procedure that gets run. And then we have a button to close the window, which is simply the delete UI command followed by our window name. And then at the end of this we show the window. All right? So let's go ahead and highlight everything, add it to our shelf. We want to say organized, so we'll go ahead and rename this tool. We can always rename this to orient joint XYZ. And I'll use this name as the tool tip. And then at that point, we can go ahead and rename the icon to JXYZ or something along those lines, and choose save all shelves. All right. So let's go ahead and run this. You'll see a window pops up. All right, so now it's just a matter of first grabbing the target joint. The joint to aim at, which is the ankle, followed by the joint that we'd like to reorient, which is the knee. And we choose apply. Not only has it gone ahead and aimed the joint, but it has cleaned up its orientation. All right? So at this point we just need to fix the twist axis of this knee, so that the Y is pointed forward. If we were to take a look at the thigh you see that it's about a value of 67. So if we were to go to the knee we can start with that value of 67. And that'll get us most of the way there. We might want to bring it in just a little bit more to about 72 or so, but that looks pretty good. All right, great. So this point now it's just a matter of parenting these together. So I'll go ahead and grab the ankle, parent that to the knee. And the knee will have parented to the thigh. Now what about the orientation of the ankle? Well what we could always do with this is go ahead and clean this up using our 0 joint orient tool. And we'll get a little warning. We also have a script to clean up the joint without looking at any aim constraints. So in this case we didn't need a name constraint for our end joint. All we did here was 0 out our rotate channels, and also the joint orient channels. So that the orientation of this matches its parent joint. All right? So we have a script, also, that we can use. We'll take a look at that little bit later. If we're just cleaning that up without looking at aim constraint as the [? ZJNT ?] tool does. All right, so we have our leg joints built. And this is a good start. We're just starting from the foundation of this rig, and then we'll add whatever auxiliary controls we will need after we're done with the base rig. All right, so if you like you can now go through and rename these joints. So just to give an idea of the naming scheme, we do have a renaming tool. It's pretty basic, but I like to use it because it just helps us to use the exact name we'll need for each object. And it helps renaming go by a little bit faster. So we'll take a look at that in the next lesson. But for the thigh we can go with something along the lines of JNT_L_Thigh_01. I'll copy the name, and use that for the knee and ankle. So this is going to be knee, then following that we can go ahead and rename that the ankle joint. And we're good to go. All right, so the leg chain has been created. Let's go ahead and stop the lesson here. And the next lesson we'll work on the toes.
In this tutorial, we will learn the methods that were used to rig the transforming robot. Throughout these lessons, we will learn the tools and techniques used in the setup process of both our robot and truck. The goal is to break this complex idea down into a simple, and manageable form. We'll cover the rigging process in its entirety, and along this journey, we'll be introduced to several tools that will help make this all come together efficiently. By the end of the course, you'll have the set of skills needed to rig your own transforming robot.
Partner
Partner
Introduction and project overview
1

Introduction and project overview

 
00:49
Starting on the robot's rig
2

Starting on the robot's rig

 
08:10
Rigging the robot's left leg
3

Rigging the robot's left leg

 
13:49
Completing the left leg's base rig
4

Completing the left leg's base rig

 
15:30
Creating a hip joint and mirroing the left leg
5

Creating a hip joint and mirroing the left leg

 
05:38
Starting the foot roll rig
6

Starting the foot roll rig

 
09:51
Connecting the reverse foot rig
7

Connecting the reverse foot rig

 
10:26
Extra joints for toe bend control
8

Extra joints for toe bend control

 
04:56
Connecting the leg and hip meshs
9

Connecting the leg and hip meshs

 
13:59
Primary leg controls
10

Primary leg controls

 
08:54
Organizing the rig
11

Organizing the rig

 
04:42
Starting on an animator-friendly foot roll rig
12

Starting on an animator-friendly foot roll rig

 
07:34
Wiring the foot roll's plusMinusAverage nodes
13

Wiring the foot roll's plusMinusAverage nodes

 
09:26
Finishing the foot roll rig
14

Finishing the foot roll rig

 
06:21
Toe bend controls
15

Toe bend controls

 
10:51
Knee controls
16

Knee controls

 
07:54
Cleaning up the leg rig
17

Cleaning up the leg rig

 
07:45
Rigging the wheels connected to the robot's legs
18

Rigging the wheels connected to the robot's legs

 
07:37
Finalizing the leg wheels
19

Finalizing the leg wheels

 
10:53
Creating a hip control
20

Creating a hip control

 
07:13
Rigging the wheels connected to the robot's hip
21

Rigging the wheels connected to the robot's hip

 
06:48
Constraining the wheel geometry connected to the robot's hip
22

Constraining the wheel geometry connected to the robot's hip

 
04:23
Dynamically parenting the hip wheels
23

Dynamically parenting the hip wheels

 
10:03
Chest control
24

Chest control

 
08:21
Completing the chest rig
25

Completing the chest rig

 
10:15
Setting up the wheels connected to the back
26

Setting up the wheels connected to the back

 
06:13
Custom attributes for the back wheels and connecting the back rails
27

Custom attributes for the back wheels and connecting the back rails

 
06:30
Dynamically parenting the back wheels
28

Dynamically parenting the back wheels

 
03:00
Constraining the spine geometry
29

Constraining the spine geometry

 
05:45
Creating a center-of-gravity control
30

Creating a center-of-gravity control

 
03:36
Rigging the neck's base plates
31

Rigging the neck's base plates

 
06:12
Setting up the robot's main neck plates
32

Setting up the robot's main neck plates

 
06:48
Re-orienting the neck joints
33

Re-orienting the neck joints

 
01:56
Rigging the neck with inverse kinematics
34

Rigging the neck with inverse kinematics

 
07:36
Optimizing the scene
35

Optimizing the scene

 
02:03
Rigging the robot's head
36

Rigging the robot's head

 
08:49
Custom attribute for the neck's base plates
37

Custom attribute for the neck's base plates

 
02:41
Starting on the arms
38

Starting on the arms

 
07:27
Setting up the elbows
39

Setting up the elbows

 
09:07
Adding arm controls
40

Adding arm controls

 
05:08
Constraining the arm groups and connect curves for the elbows
41

Constraining the arm groups and connect curves for the elbows

 
10:14
Dynamically parenting the arms
42

Dynamically parenting the arms

 
02:27
Rigging the fingers
43

Rigging the fingers

 
08:01
Connecting the fingers
44

Connecting the fingers

 
03:11
Creating finger controls
45

Creating finger controls

 
05:38
Wrapping up the hands
46

Wrapping up the hands

 
12:29
Starting to rig the arm pistons.
47

Starting to rig the arm pistons.

 
06:39
Finalizing the pistons
48

Finalizing the pistons

 
12:20
Finishing the robot's rig
49

Finishing the robot's rig

 
08:00
Beginning the truck's rig
50

Beginning the truck's rig

 
03:14
Rigging the truck's wheels
51

Rigging the truck's wheels

 
04:13
Automating the wheel rotation of the truck
52

Automating the wheel rotation of the truck

 
07:14
Finishing the wheel rotation expression
53

Finishing the wheel rotation expression

 
02:53
Rigging the truck's body and controlling the front tires
54

Rigging the truck's body and controlling the front tires

 
05:14
A technique for simulating tire pressure
55

A technique for simulating tire pressure

 
03:21
Wrapping up the tires
56

Wrapping up the tires

 
08:40
Finalizing the transforming robot's rig
57

Finalizing the transforming robot's rig

 
07:08