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 25-03-2006, 05:48 AM   #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 Another piece of code from Walkerman . .

This is part of the code the is used to build the sliders for various controls in the Walkerman window.

First, I check to make sure that the Left Index finger really exists.
The reason to do this is it makes the code very robust, it is harder to do something that will "break the code". . . you can delete parts of the Walkerman skeleton, and the rest can still function. Say for example you want to make a creature with only three fingers.

Here the code creates the slider control for FL2J1.rotateY, and the 4 buttons to control it. . .

// Check for Left Index finger
if (`objExists $FL2J1`){

// Now we create a string to initiate the building of a slider.
$attr = $FL2J1 + ".rotateY";

// create the slider
attrFieldSliderGrp -label "Point Finger Y" -min -.5 -max .5 -at $attr;

// Set Default value for the slider
string $c = "setAttr " + $attr + " " + 0;
// Create the button for the action
button -label "D" -annotation "Default Setting" -command $c;

// Build a button to select the FL2J1 Joint
string $c = "select -r " + $FL2J1;
button -label "S" -annotation "Select Joint" -command $c;

// Build a button to set the keyFrame on the FL2J1 Joint
string $c = "setKeyframe " + $attr;
button -label "K" -annotation "Set Keyframe" -command $c;

// Build a button to cut the keyFrame on the FL2J1 Joint
string $c = "cutKey -cl -t `currentTime -q` " + $attr;
button -label "U" -annotation "Cut Key" -command $c;


If the joint does not exist, the whole process in the brackets is skipped.
"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.