SimplyMaya Forums

Welcome to the forum, feel free to ask questions here.

Home / forum / Animation / Mel Scripts & Programming / Another piece of code from Walkerman . .
Register FAQ Members List Calendar Mark Forums Read

New Thread
 
Thread Tools
Old 25-03-2006, 04:48 AM   #1
skywola
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
New Thread

« Previous Thread | Next Thread »

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

1 Month

$34

Month-to-month billing
$34/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
 
 

3 months

$87

Billing every 3 months
$29/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
Save $5 per month or $15 in total compared to monthly billing with this package.

12 months

$288

Billing every 12 months
$24/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
Save $10 per month or $120 in total compared to monthly billing with this package.

Your plan will automatically renew. You can cancel at any time via your PayPal account to avoid being charged again.

You can view the FAQ on our video plans here. You can contact us directly here. By clicking one of the buttons above, you agree to our Terms and Privacy Policy.