Reusing rigging information for other characters?


#1

I’m about to start on the first scene of my animated short, and I have a pretty important question:

How much and which parts of my rigging for a character could be reused by other characters? The bones? Skinning? Deformation? The IK’s? The blend shapes?

For example, I have the following main characters:

Man
Woman
Little girl
Little boy
Old man

Now, I understand that if I have characters that are very similar in their physique, I could probably reuse some stuff, but what can I reuse if the physique of the characters are as different as the above listed characters?

Basically, I need to know WHAT data and nodes I SHOULDN’T delete when rigging the first character, so that I can reuse those data again for other characters.


#2

I’ve just completed my first animated short and I have reused my main character rig 3 times. Covering a male adult, an elderly female and a 4-year-old child. Having the same rig for each character makes things a lot simpler as you only have to know one rig.

Bones can be easily re-sized and positioned for new characters, and IK setups should follow. If you have any constraints you may need to adjust them for the new character.

However, the program I use (MAX) does not support reusing skinning and deformations (correct me if I am wrong). It sounds like you are using Maya, so I don’t know if it is possible in that program.

I would say reusing character rigs is definitely possible and I would highly recommend nutting it out because it saved me several days work.

I hope that helps


#3

Bennels, how did you reuse the rig?
Ive been trying to use the IKJoe rig with my own mesh, but some of the bones wont resize properly…

I would hate to miss something obvious, as im now building my own rig. (would hate to have to do that too many times)

E.T


#4

ET: Unfortunately I’m using MAX 4.2 and I’ve not had the chance to pull apart this infamous rig. You may need to break it a little to move some bones, and then try and put it back together. :shrug:

Sorry, i’m not much help on that one. I’ll do a bit more research on the IKjoe rig.

Cheers


#5

Most of my rigging for bipedal creatures is automatic. The beatuy of MEL is that you can script the usual grunt labour you repeat all the time…


#6

yep, same here… makes things so much easier. Plus, you can experiment with specific parts of a rig… say your biped character is 99% the same as another character, but it has pig tails… you can rig it in seconds with your standard rig, figure out somethign for the pig tails, and then from then on you’ve got a pig tail setup you can use for any of your other creatures.

super handy.

-jason


#7

Ok, stupid newbie moron question time:

In order to script the mel for rigging, do I just grab all the steps I went through with the first rig from the script editor, and then drag them onto a shelf button? Or am I spewing newbie stupid nonsense?


#8

The best thing to do is approach it in a way that you’d approach writing any modular program… break it down into the steps that you’re going to be taking.

For example, first you need to figure out how you want to build the rig… do you want it based on the skeleton, or do you want to do it based on locators that define certain regions of the creature? The important thing is that you need a base to start with. So let’s take the locator method as an example…

First, you would load in the scene that has the geometry and create locators based on where you want things to be. Because you know that you’re going to be building a skeletal structure based on the locators, you want to ensure that the naming is consistent and correct. So what you would do is place locators where you want, for example, the up arm, elbow, and wrist to be.

So you name the locators l_up_arm_loc, l_elbow_loc, l_wrist_loc.

Then, you’re going to make a program that does the following:

  1. Determine whether or not you’re building a right or left sided arm (l_ or r_).
  2. Find the appropriate locators (l_up_arm_loc, l_elbow_loc, l_wrist_loc).
  3. Build a joint structure that moves through them.
  4. Build an ikHandle
  5. Create the control structure you want
  6. Set the correct attributes keyable/unkeyable/locked
  7. Hide things that you don’t need to see.

So start breaking this down… into mel. You know that you’re going to be making this a “procedure” or individual program that can be called from a larger program. And you also know that you need to pass it either a left or right side, so it knows what to do. So you would define the procedure and the variables that you’re going to pass it:

global proc buildIkArm (string $side)
{
    // Take an argument ("l_" or "r_") and build
    // an ik arm.  
}

This is a simple procedure which that simply will take an argument and does nothign with it at this point… but it will do something eventually.

Now you want to add the second part… where it finds the locators that it needs. You can do that using the $side variable, and the fact that we KNOW that the things will be labled up_arm, elbow and wrist:

global proc buildIkArm (string $side)
{
    // Take an argument ("l_" or "r_") and build
    // an ik arm.  

    // get the names of the locators
    $up_arm = ($side + "up_arm_loc");
    $elbow  = ($side + "elbow_loc");
    $wrist  = ($side + "wrist_loc");
}

now that we know those, we’re going to start building joints through them. To do that you need the location of those locators in space, and you need to know the joint command. To find the location in space of an object, you can either use the xform command (xform -q -worldSpace -rotatePivot) or use the getAttr command if the locators aren’t a child of anything else. I prefer the xform command 'cuz I know it’ll work…

global proc buildIkArm (string $side)
{
    // Take an argument ("l_" or "r_") and build
    // an ik arm.  

    // get the names of the locators
    $up_arm = ($side + "up_arm_loc");
    $elbow  = ($side + "elbow_loc");
    $wrist  = ($side + "wrist_loc");

    // find the world space of the locators, and
    // create joints that are in the right place
    $uap = `xform -q -ws -rp $up_arm`;
    $ep  = `xform -q -ws -rp $elbow`;
    $wp  = `xform -q -ws -rp $wrist`;

    $up_arm_joint = ($side + "up_arm");
    $elbow_joint = ($side + "elbow");
    $wrist_joint = ($side + "wrist"); 

    // now each of the pos variables are arrays.
    // we can use them to create the joints.
    select -d;
    joint -p $uap[0] $uap[1] $uap[2] -n $up_arm_joint;
    joint -p $ep[0] $ep[1] $ep[2] -n $elbow_joint;
    joint -p $wp[0] $wp[1] $wp[2] -n $wrist_joint;
	
    // now orient them correctly
    joint -e -oj xyz $up_arm_joint;
    joint -e -oj xyz $elbow_joint;

}

see how this is progressing? basically, you see what it is you need to do, then search the mel docs for the commands required. The next step was to make the ikHandle. Just guessing you can assume that it requires the ikHandle command… type

help -doc ikHandle

and you’ll find that there is example code to help you out.

global proc buildIkArm (string $side)
{
    // Take an argument ("l_" or "r_") and build
    // an ik arm.  

    // get the names of the locators
    $up_arm = ($side + "up_arm_loc");
    $elbow  = ($side + "elbow_loc");
    $wrist  = ($side + "wrist_loc");

    // find the world space of the locators, and
    // create joints that are in the right place
    $uap = `xform -q -ws -rp $up_arm`;
    $ep  = `xform -q -ws -rp $elbow`;
    $wp  = `xform -q -ws -rp $wrist`;

    $up_arm_joint = ($side + "up_arm");
    $elbow_joint = ($side + "elbow");
    $wrist_joint = ($side + "wrist"); 

    // now each of the pos variables are arrays.
    // we can use them to create the joints.
    select -d;
    joint -p $uap[0] $uap[1] $uap[2] -n $up_arm_joint;
    joint -p $ep[0] $ep[1] $ep[2] -n $elbow_joint;
    joint -p $wp[0] $wp[1] $wp[2] -n $wrist_joint;
	
    // now orient them correctly
    joint -e -oj xyz $up_arm_joint;
    joint -e -oj xyz $elbow_joint;

    // add an ikHandle
    $handleItems = `ikHandle -sj $up_arm_joint -ee $wrist_joint -n ($side + "_arm_ikHandle")`;

}

see how it works?

the best thing to do is look at the script editor as you’re trying stuff & see what commands get echoed… then read the docs on those commands… and discover how to use them to your advantage.

hope this helps some & gets you going on the right track!

-jason


#9

Well I don’t know about you guys, but I’m doing that tomorrow.

Thanks for taking the time Jason, I guess you have a bit more of it now though ;^) can’t wait to see it on the big screen.

cu
.j


#10

Nice response Jason. That should get Lunatique started on the right track…I saw a few things I could do to enhance my scripts too. I get nervous around Xforms…my brother was killed by an Xform…sigh

:slight_smile:

Thanks.!


#11

heh, glad it’s going to be helpful… I’m actually in the process of re-working my whole pipeline at home to keep things more interesting… should be fun. :slight_smile:

-jason


#12

Jason- WOW! Thanks for pointing me the right direction!! You’ve always been one of my favs at cgtalk, since you are a busy bee working at a big studio, but still take the time to help out the cgtalk community, and is totally down to earth and easy going.

I feel like I have a huge mountain in front of me that I have to climb, and the peak it up there in the clouds where my eyes can’t even see. Attempting to make an entire animated short as a 3D newbie, while learning each step of the way is VERY daunting. But with great people like the cgtalk guys/gals around to help out when I get stuck, I feel a bit more optimistic. :slight_smile:

Now for another question:

Aren’t locators just part of the skeleton? If the two systems are different, what are the pros and cons of building a system based on skeleton vs. locators? I will not be dealing with any non-human characters, and my characters will all be animated in a realistic manner(not exaggerated cartoony style). There will be a lot of closeups on the face and hands, as they express a lot of emotions. Oh wait, I do have to rig a flock of pigeons too. So, ok, add a pigeon rig to that.


#13

huh, who needs them trianing dvd’s
getting alllll the info right here

thx jason

|jason


#14

yo jason nice! that helps me out and i can see how to almost write the whole thing in mel, but how would i do something like adding a hand rig to that, to place the joins in space do i have to havea locator for each one? or what do u recomend

thx

peace


#15

awesome response Jason… I love it.


#16

Heya Lunatique,

Aren’t locators just part of the skeleton? If the two systems are different, what are the pros and cons of building a system based on skeleton vs. locators?

That’s a good question… it really depends on how you want to work yourself. I usually do things based on the skeleton, because I want to have absolute control over where joints are and what their orientation is. So the first thing I do is build a skeleton to fit a model. Then, my scripts run through that skeleton and build the animation rig based on where the joint locations are. That way, if I have a new model that I want to animate, I can import the skeleton, adjust it as necessary, and run the rigging scripts and it builds the animation rig for me.

If, however, you want to build the skeleton procedurally, you still need to provide information to your scripts as to where the joints should be… that’s where the locators come in. So instead of building the skeleton first and then building the rig… you’re placing locators where you want the skeleton to be built, then letting the rig building script handle BOTH the skeleton and the animation rig.

So you can kinda break it down like this:

o Import Model
o if you want to have the script automatically generate the skeleton, then:
o Create Locators
o Generate Skeleton
o Build rig based on skeleton

hope that helps explain things a bit… :slight_smile:

Twisted Imperia,

but how would i do something like adding a hand rig to that, to place the joins in space do i have to havea locator for each one? or what do u recomend

That’s usually why I build the skeleton rig myself first… however, something I’ve found really “handy” (ahem… sorry. :), is because hands are so difficult and time consuming to get right, I usually have a “hand file” which is separate… then I make that part of my “buildHandRig” script… it imports that file and takes all the animation curves from the joints (usually setDrivenKeys) and re-connects them to the appropriate joints on the skeleton which is going to be my animation rig.

So you have an entire script which looks like this:


global proc buildAnimationRig ( string $character )
{
    // the skeleton is already loaded.. begin 
    // putting the anim rig together

    // import the geometry
    importRigGeometry $character;

    // parent the geometry
    // all the geometry is named the same thing as
    // the bones that are in the scene.. just with
    // a _geo at the end.  So the geometry for the
    // "root" joint is named "root_geo".  This
    // makes it easy to automatically parent the 
    // geometry.
    parentRigGeometry;    

    // build the arm controls
    buildIkArm "l_";
    buildIkArm "r_";

    // build the leg controls
    buildIkLeg "l_";
    buildIkLeg "r_";

    // build the back controls
    buildWickedSpine;

    // add facial animation
    buildFacialRig $character;

    // add hand controls
    buildHandRig "l_";
    buildHandRig "r_";
  
    // clean everything up
    setLayerAttributes;
    hideUnneededObjects;
    optimizeTheScene;
    checkAnimatableAttributes;

    // add character sets
    addCharacterSets;

    print ("Finished creating " + $character + " animation rig.
");

}

then the procedure for the hand rig might look something like:


global proc buildHandRig (string $side)
{
    // this procedure will import the hand rig
    // and connect the joints

    // find the rig
    string $rigEnv = `getenv "CHARACTER_RIG_FILES"`;

    string $handRig = ($rigEnv + "/handRig.ma");

    // import the hand rig
    file -import $handRig;

    // now connect things using really tricky mel

    // now remove the temporary hand rig
    delete topNodeOfTemporaryHandRig;

}

see how that would work?

oh… and stal3fish…

huh, who needs them trianing dvd’s getting alllll the info right here

whatcho talkin 'bout willis! I got 15 childrens ta feed, a mom who’s sick with the gout, and a gallstone the size of mt. everest… buy mah damn dvd! <grin>

hope this was helpful!

cheers,
jason


#17

I get nervous around Xforms…my brother was killed by an Xform…sigh

haha. :slight_smile: I just saw this for some reason… you crazy bastard! :slight_smile:


#18

Jason- Thanks for the explaination! At this point, most of it goes right over my head, since mel looks scary to me. But, I’ll have to bite the bullet and learn it if I want my production pipeline to flow more freely.

Just so that I can you help feed your 15 children, take care of the mother with the gout, and a gallstone the size of Himalaya–no, wait, Mt. Everest, I went ahead and ordered $2,425 worth of training material from A/W, Gnomon, and Amazon.com. And yes, that’s in American dollars.

I figured, if these teaching materials are put together by guys like you and Alex, they definitely pay for themselves in 10 folds when I sponge all that knowledge up. I need to have the quickest and dirtiest way to get my short up and running for production, and I just don’t have the time to sit there for a year to fumble through everything by trial an error. I need to know the most effective pipeline and ways of working right off the bat, and guys like you and Alex are my guiding light.


#19

haha :slight_smile:

glad to be able to help out! and please… don’t hessitate to ask questions and throw out ideas and share concepts and stuff like that. It’s a growing industry and we’re all learning every day!

I’ve got my own short I’m trying to figure out as well… it’s a fun but frustrating (at times) process! :slight_smile:

-jason


#20

Incredible, I wish I had Jason’s brain…
Lunatique, if you fail at mel like me you might want to have a look at the JointFactory, a script that creates the best, most complex and yet most flexible and easily animated human rig I’ve ever seen, created by a couple norwegian guys working on a feature film. It’s free at Highend3d.com