Spline Control Tutorial

------------------
rancie_@hotmail.com

This is for all those people who pulled me from what I was doing to show them
that "rig thing I did."  (Don't get me wrong, I love the attention!)  Now you can
save this document to your hard-drive and read it when ever you like!  Enjoy!

1.  Bone up for your rig...

Draw your bones out in your geometry the best as you see fit.

Here's a good time to name and orient your joints, like so...



Choose the Joint Orient Tool from the Animation Tab (double clicking to get the options box).
Choose YXZ for the Orientation and select the Orient Child Joints check box to on.
Select the ROOT joint (the ultimate parent in this situation) and hit Orient.
What you see in the picture above is the result of that.  Y is now "down the bone,"
which means that the orientation of the joint has Y pointing to the next joint in the
string.  Notice that X and Z are haphazzard--that happens.  (don't ask that
question yet, it's covered next...)

2.  Fix what Maya had tried to do...



Get your butt into subcomponent mode (1), then choose the Question Mark (2)
which unmasks your Local Rotational Axis viewing (3).  Now you can see the
orientation of your joints.  You CAN rotate your axis manually, but I suggest using one of
these quickies:

rotate -r -os 90 0 0 ;
rotate -r -os 0 90 0 ;
rotate -r -os 0 0 90 ;

X, Y, and Z.  Straight forward, right?

Paste into your script window and use the Enter key on the numeric side to execute.
(You could drag and drop these to your shelf to make your life easier...)
Right, now, you see the World Orign in the lower left hand of the image...
try to make either X or Z follow that.  In this case, X is the easier choice.  Make
it happen and then meet me at step 3.

3.  Test, test, and then test again...

Select the Root joint, hold shift.  Grab the next joint, and the next, and the next, and
the next, and...you get the point.  Don't worry about the last one, it's not doing anything.
Rotate them in a linear direction (one axis at a time)  They should curl like the image shows.
If they don't, then you messed up step 2.



Undo that rotation and then move on to....

4.  Ooo....curves....

Best to use the grid to your advantage, here, in this one....Side ortho.
I use a Linear Curve (straight), but that's my prefrence, you can use a Cubic (curvy) if you like
(create->EP Curve [Options Box]).  Snap the draw points to the grid (hold X), hit enter to
compete the curve.  Hit Insert to move the orgin and grid-snap (hold X) it to the start
of the curve.  Lookin'e like this?



5.  To group to buffer...

Group your curve to itself (ctrl-g) and then grid snap the orgin to the same spot as before.
Looking at your Hypergraph, you should see what's in the image.  Snap the group in its position
(Hold V) to the joint you want controled--not the ROOT, though.  That's later...

Redo steps 4 and 5 for the joints you need to control...See this:



---------------------------INTERMISSION---------------------------
Why are we doing this?  Well, you just sit right there, and Uncle Jim will explain...

Out mission here is use the curves to control the joints.  The reason here is two-fold:
1) so we never have to touch a joint again in our lives (it's bad form)
2) so the controls stick outside the geometry

To do this, we will pipe rotation information from the curve into the joint:

CURVE         JOINT
 X=90  ---->  X=90
 Y=45  ---->  Y=45
 Z=12.5  -->  Z=12.5

Now we can set key frames on the curve and when it rotates, it will force the
joint to rotate.  Thus allowing us to never touch a joint!  If we use this smartly,
we can set it up so that all the curves are in one tree, and all the joints are in
another tree.  This allows us to mass-key all the curves at the same time for
our pose-to-pose animation, without keying any joints.  And, they're sticking outside
the geometry!

Now, why the silly grouping thing we just did in step 5?  You'll see...

6.  Orentation 101

Now, if we're gonna match the curve rotation to the joint rotation, then they
should be exactly the same orientation to start out with!  Okay, so let's do this thing:
Grab the joint (master), then grab the curve's group (slave).  Contrain->Orient.  The curve's
group's rotations will turn blue like in the image.  Your curve will jump and align with the Joint's
orientation.  See in the image how it looks aligned?  Cool, huh?  Do this for all of them.




Okay, back to the question poised before:  Why the silly grouping thing?
Well, see, it's like this...when you create a joint it has no rotational info (x=0, y=0, and z=0).
You change the orgin, and it still has no rotational info.  You create a curve and it has no rotational
info, also.  Now, if you do the Orient Contraint in Step 6, then the curve get rotations!  Zero must meet zero
if we are to prevent the joint from instantly getting rotations when we pipe the curve's rotations into
the joint.  We group the curve to itself and manipulate the group.  The group get's rotations and transformations
but we dont care about that.  The curve under it, though, stays at perfect zero and is virgin for when we plug its
info into the joint.  Got that?  I sure hope so.

7.  Done with contraints...

In the hypergraph, select all the Orient Contraints and hit DEL.  They've serverd
their purpose and will only confuse Maya later on in the process.



8.  Let's Plug!!

Open your trusty Connection Editor.  This is the meat and potatoes, here, boys and girls!
For the left hand slot, choose the curve (not the group) and hit Reload Left (click, click).  
For the right slot, choose the Joint and hit Reload Right (click, click).  Pipe rotates through;
watch them go italic and watch your joints rotations go yellow.  So, far, so cool.



For a test, grab the curve and rotate it.  The joint should rotate exactly the same way (nevermind the
other curves don't do anything yet).  Make sure to Undo that rotation.

Do the same Plug for the rest of the curves, makeing sure to test each on as you do it.  I can't stress
enough that you test as you go along.  It will save you loads of Oops-time later.

9.  Parents and Children...

When you rotate a joint, all the joints above (visually, not in the hypergraph) it rotate in a solid manner,
this is because they are children of that joint.  Well, we are going to set up a parent-child setup with
the curves so that when you rotate a curve, the one's above it (again, visually) rotate solidly.

In the image below you can see the way the curve will control the next in the sequence.



Test, test, test:  Rotate the curves.  The children should follow the joint's children
exactly.  Cool, eh?




10.  I don't follow....

All's good, right?  You rotate, they rotate.  Love, peace, and chicken grease.
Okay, now I'll just move my joint chain over here....ah, crap!  Two things wrong here!
1) I had to touch a joint to move it!  (Ewww!)
2) My curves didn't follow--they stayed behind!

No problemo, mi amigo!  We have a fix for that:

Create a new curve to your liking and snap it to the ROOT joint.  Name it something important
sounding and then freeze its transformations

(Modify->Freeze Transformations) to get what you see in the next image:



It doesn't need a group above it, because you won't rotate the ROOT.  You shouldn't rotate
the root, right?  Right.  This curve will be the "master key" curve.  That, I'll explain later.

Now, what we want to happen here, is to have the ROOT joint follow the Master_Key
curve.  The curve is the master and the joint it the slave so we...
select the curve (master), and then the joint (slave) and Constrain->Point.
Now when we translate the curve, the joint chain follows.  Just parent the
curve chain we created before under the Master_Key and now the curves will follow as well.



---------------INTERMISSION---------------

Allright, stop here a sec, let's explain the existence of the Master_Key.

Take a peek at this image:



In the set key options, check the radio buttons that I've indicated.  You want to
key "All Keyable Attrbutes", that's a no brainer, but just better safe than sorry.

Now the second button is the important one.  This one tells Maya that when you hit the
S key to set a key, you want that item keyed and all those itmes below it!  This is a
friggin' awesome setting!  If you pose your joint chain using the curves, then select the
Master_Key curve and hit S, then ALL the curves get keyed in that spot on the timeline.
You just keyed an entire pose (for you're pose-to-pose animation).  Neat, ain'a?

EPILOGUE
Allright, before you go out and play, there's one thing you need to do...you need to lock
off those items that would get keyed, but that you don't want to get keyed (it makes sense,
I swear!).  If you key a curve and its group, then which has control?  The group does.  You
don't want this.  So make sure to lock off those attributes!



Do the same to the Master_Key, but don't include the Translate info (or how would you move it?).



Congrats!  You're done!  

You can see from the hypergraph how the two trees are completely seperate, but the joints
follow suit because of the setup you did.  



Granted, riggin a full character like this is a bit more involved, but
with this basic knowledge and a bit of tinkering, you should be able to figure it out in no time.

Hope all this helped!

Want to download the file I used in this tutorial?  CurveControlTutorial.mb

Questions and Error notifications to rancie_@hotmail.com please!

Click here to bookmark this tutorial!

Copyright:  I wrote this tutorial, and these are my images, but the idea is not a new one, so
if you copy this tutorial or distribute it, then just leave my contact and authoring info intact please.
Jim

Copyright © 2004 James A Zonta
All of them funky rights, like, reserved, man. Galluptious.