This is a detailed explaination of the Walkerman procedure for creating a biped skeleton . . . .

If you want a procedure to only be callable within a larger procedure, you would build it this way:

proc nameOfProcedure (){

procedure coding . . .

} <---- after you forget this bracket a few times and spend a few
hours trying to figure out why the hell your code is not
working, you will remember it without fail.

If you want to be able to call your procedure from other procedures within your script folder . . . . always want to put the "global" keyword in front of "proc".

global proc nameOfProcedure (){

procedure coding . . .

} After you forget to put "global" there few times and can't
get your procedure to run you'll make it a habit . . . . it is
really rare to NOT use global. . .

This addSkeleton procedure has something else though . . .

global proc addSkeleton (int $n){

In the parenthesis, it has "int $n". This is how you pass something into a procedure. It is called passing a parameter.
the $n is considered to be the parameter. You should include the variable type too, in this case "integer".

When the procedure is called in code, it will look like this:

addSkeleton 1; or

addSkeleton 3;

It really appears in the Walkerman program as:

addSkeleton($n);

Why would I want to pass a parameter?

Because this procedure builds the skeleton . . . every time I build a skeleton, I need to have unique names, so if I build two characters in the scene, there will be no confusion whenever I need to control one of them. So by naming the first skeleton
with a name followed by a number, it makes every part of that skeleton unique. When I build the next skeleton, I just increment the number.

skeleton1 . .. skeleton2 . . . . skeleton3 . .. etc. . .

So on the first skeleton, for example, if you want to rotate X on the left shoulder, you would do it on the joint called

Here each joint name is created with the parameter that I mentioned earlier to uniquely ID each character part that is created. Also, I used short coding names to limit coding clutter and they really are simple, like bb = base back, hc = hip center
hr = hip right, kr = knee right etc. So I get bb1, hc1, hr1, kr1 or for the second character I would have bb2, hc2, hr2, kr2.

About Us

A little bit about who we are

People we like

Links you might find useful

Connect with

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.