SimplyMaya Forums

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

Home / forum / Animation / Mel Scripts & Programming / shelfButton command
Register FAQ Members List Calendar Mark Forums Read

New Thread
 
Thread Tools
Old 08-06-2006, 06:54 PM   #1
Dann
Registered User
 
Dann's Avatar
 
Join Date: Feb 2003
Location: Los Angeles
Posts: 695
Thanks: 0
Thanked 2 Times in 2 Posts
Default shelfButton command

I know I've used this command before, but I can't get it to work today. According to the Maya docs, the following should make a button.
shelfButton -annotation "Print \"Hello\"."
-image1 "commandButton.xpm" -command ("print \"Hello\\n\"");

It doesn't work. It needs to know the parent to know which shelf to put it in. Can anyone remember how to query the active shelf?

Thanks.


*** EDIT :attn:
How came after struggling with something and finally decideing to post looking for help, I always find the solution on my own minutes later?

global string $gShelfTopLevel;
if (`tabLayout -q -isObscured $gShelfTopLevel`) error -sl on "Please make a shelf visible.";
-parent (`tabLayout -q -selectTab $gShelfTopLevel`)

Last edited by Dann : 08-06-2006 at 07:18 PM.
Dann is offline   Reply With Quote
Old 09-06-2006, 01:26 AM   #2
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

Experientia docet - - - Experience teaches

I have found that the more I have learned about MEL, the more often I am able to solve my own problems with coding . . . so I guess that is a good sign for you. . .
__________________
"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.