Maya Training

Creating characters In Maya and Zbrush

Maya Training

Creating character renders in Maya 2017 and Arnold

Maya Training

Spach-Alspaugh House the complete courseware
You are here > Home > SimplyMaya Community Forums

Welcome to Simply Maya

Please Sign in or Sign up for an account

Member Login

Lost your password?

Not a member yet? Sign Up!

Old 10-03-2006, 12:12 PM   #1
Registered User
skywola's Avatar
Join Date: Jan 2004
Location: Tempe, Arizona, USA
Posts: 224
Thanks: 0
Thanked 0 Times in 0 Posts
Default Walkerman's addBodyCode Procedure

This is the third procedure called, in the Walkerman program.

If you are stepping thru Walkerman with the script editor, you would be doing this:

int $n = 1;

Then we come to this procedure:

global proc addBodyCode (int $n){

Here we are just building strings so we can use them later in the code. . . .
string $bb = "bb" + $n; // gives "bb1"
string $hc = "hc" + $n; // gives "hc1"
string $hl = "hl" + $n; // gives "hl1"
string $hr = "hr" + $n; // etc . . .
string $ls = "ls" + $n;
string $rs = "rs" + $n;

Now the FUN part . . .

Here we build the string we need to add the mathematical coding for the expression we want.

string $exp1 = $hl + ".rotateZ = " + $hl + ".legSpread + tan(" +
$bb + ".clock * " + $hc + ".hipSwing/" + $bb
+ ".initYposition - .5)-5.74;";

Not a wide enough window to show the expression properly here, but it builds to a string:

hl1.rotateZ = hl1.legSpread +
tan(bb1.clock * hc1.hipSwing/bb1.initYposition -.5)-

Now we actually create the expression:

expression -s $exp1 -o hl -ae 1 -uc all;

Jumping to a easier expression:

string $exp3 = $ls + ".tx = -"+ $rs + ".tx;";

builds the string:

ls1.tx = -rs1.tx;

Then we create the expression:
expression -s $exp3 -o rs -ae 1 -uc all ;

Everything that follows is basically the same functions being repeated to create coding for all the joints in the body. . . . and lots of fun stuff like MATH - a fun can of worms to open up if you have the time and patience. . . .

Keep in mind that the code

ls1.tx = -rs1.tx;

could also be:

ls2.tx = -rs2.tx; or ls4.tx = -rs4.tx;

Depending on which character number you are building.

Then we want the parent of all the joints selected as we exit the procedure . . .

select -r $bb;


The only complicated part of this procedure is the math . . . .
Building the sttings for the code can be a pain too, but you can print the expressions out in the script editor to see what they look like and then edit them as needed.
"The Sage as an Astronomer: If you still see the stars as something above you, you lack the eye of knowledge." Friedrich Nietzsche
skywola is offline   Reply With Quote

A little bit about who we are
Links you might find useful
Catch up with SimplyMaya
SimplyMaya specialises in Maya tutorials. We offer over 1,000 individual Maya training videos, ranging from basic Maya tutorials through to intermediate Maya tutorials. Our tutorials are created by instructors with industry experience and are designed to get you up and running in Maya quickly without making it seem like hard work.

Copyright © 1999-2017 SimplyMaya - vBulletin® Copyright © 2000-2017, Jelsoft Enterprises Ltd.