SimplyMaya Forums

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

Home / forum / Animation / Mel Scripts & Programming / Apply Maya's Images onto a Shelf Button
Register FAQ Members List Calendar Mark Forums Read

New Thread
 
Thread Tools
Old 20-10-2007, 05:22 PM   #1
BennyK
Registered User
 
BennyK's Avatar
 
Join Date: Oct 2007
Location: IL
Posts: 738
Thanks: 0
Thanked 3 Times in 3 Posts
Question Apply Maya's Images onto a Shelf Button

I'm creating my custom shelf and I can't find the location of the icons that are already applied on other shelf buttons, such as the up and down arrows on the undo & redo buttons in 'General' shelf.
Also, is there a way to copy (not move) shelf buttons from one shelf to another?

I'm using Maya 8.5.
Benny
BennyK is offline   Reply With Quote
Old 20-10-2007, 06:13 PM   #2
t1ck135
Registered User
 
t1ck135's Avatar
 
Join Date: May 2004
Location: UK
Posts: 1,991
Thanks: 0
Thanked 0 Times in 0 Posts
Default

A couple of options for you:

- To create a new shelf icon image simply do a screengrab of Maya's viewport, cut the relevant bit out (making sure the size is 32x32 pixels). Now modify the icon in something like photoshop and save as a .bmp to a location where you can load it from. I usually put it in:
<drive>:/Program iles/Autodesk/Maya<version>/icons/<myiconfolder>/new_icon.bmp
or:
<drive>:\My Documents\maya\<version>\prefs\icons
but you can put them anywhere really

- To use an existing or newly created shelf icon go to Window -> Settings/Preferences -> Shelf Editor. A window pops up which allows you to choose shelves and shelf contents. Choose the shelf button you want to change the icon to and click the 'change image' button.
Now locate where the icon you want is (if using the first step above) and it will add it in.

- To copy a shelf item, first open up your script editor (Window - > General Editors -> Script Editor) and press the shelf item that you want to copy. You should see a Mel command(s) appear in the script editor. Highlight that code and middle mouse button drag it to your shelf. A popup will appear asking if you want it to be Mel or Python - choose Mel

Si
__________________
Examples of bTraffic - a traffic animation tool for Maya
bFlocking - a tool for Maya 8.5+ to generate flocking and swarming behaviours
Jan/Feb Challenge 2007 Entry and W.I.P
May/Jun Challenge 2006 Entry and W.I.P
Mar/Apr Challenge 2006 Entry and W.I.P
Jan/Feb Challenge 2006 Entry and W.I.P
Nov/Dec Challenge 2005 Entry and W.I.P
Sep/Oct Challenge 2005 Entry and W.I.P
Jul/Aug Challenge 2005 Entry
www.flash-fx.net

Last edited by t1ck135 : 20-10-2007 at 06:16 PM.
t1ck135 is offline   Reply With Quote
Old 21-10-2007, 03:18 AM   #3
BennyK
Registered User
 
BennyK's Avatar
 
Join Date: Oct 2007
Location: IL
Posts: 738
Thanks: 0
Thanked 3 Times in 3 Posts
Default

I know how to create, use and apply an image.
I just couldn't find the location of the icons besides some of the create polygons and NURBs icons. I thought I won't have to screenshot them because they should already exist.

And by copy a button I meant to move it (together with it's image) (like you MMB drag it to another shelf/bin) but I need it to stay in it's original location...

Benny
BennyK is offline   Reply With Quote
Old 21-10-2007, 09:01 AM   #4
BennyK
Registered User
 
BennyK's Avatar
 
Join Date: Oct 2007
Location: IL
Posts: 738
Thanks: 0
Thanked 3 Times in 3 Posts
Default

I found a way to copy a button but it doesn't work everywhere - Select the tool and MMB drag it's icon from the tool box.

I also encountered another problem when not doing it this way: When you double-click a button it doesn't open the tool settings like in a normal button.

Is there another way to copy a button which works with every button in the shelf?
Is there a way to make a custom button open the tool settings on double-click?
BennyK is offline   Reply With Quote
Old 21-10-2007, 09:17 AM   #5
BennyK
Registered User
 
BennyK's Avatar
 
Join Date: Oct 2007
Location: IL
Posts: 738
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Also, how can I copy a menu button to the shelf(without using the script editor)? I've seen it in some videos but I can't manage to do that .
Thanks in advance,
Benny
BennyK is offline   Reply With Quote
Old 22-10-2007, 01:53 AM   #6
t1ck135
Registered User
 
t1ck135's Avatar
 
Join Date: May 2004
Location: UK
Posts: 1,991
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Maya help - search for shelf info - very handy info
(Add a tool, action, or Maya script to a shelf)

copy = control + shift + middle mouse button and drag to required area

Copying wont pass on the double click action. Looking in the My Documents\maya\<version>\prefs\shelves section and opening one of the files shows that a -doubleClickCommand is assigned to control double clicks. I dont think editing the file works as maya refreshes it on startup (I havent confirmed that tho)
Alternatively have a look into the Commands or CommandsPython sections of the manual and it shows you the script editor commands to create shelf buttons (shelfButton) and control all the elements including double click.

go experiment
Si
__________________
Examples of bTraffic - a traffic animation tool for Maya
bFlocking - a tool for Maya 8.5+ to generate flocking and swarming behaviours
Jan/Feb Challenge 2007 Entry and W.I.P
May/Jun Challenge 2006 Entry and W.I.P
Mar/Apr Challenge 2006 Entry and W.I.P
Jan/Feb Challenge 2006 Entry and W.I.P
Nov/Dec Challenge 2005 Entry and W.I.P
Sep/Oct Challenge 2005 Entry and W.I.P
Jul/Aug Challenge 2005 Entry
www.flash-fx.net

Last edited by t1ck135 : 22-10-2007 at 01:58 AM.
t1ck135 is offline   Reply With Quote
Old 22-10-2007, 03:57 AM   #7
BennyK
Registered User
 
BennyK's Avatar
 
Join Date: Oct 2007
Location: IL
Posts: 738
Thanks: 0
Thanked 3 Times in 3 Posts
Thumbs up Thanks

I configured the preferences and copied some sections from other shelves and it works so far...
Ctrl+Shift+MMB drag doesn't work to well...
Thanks again,
Benny
BennyK is offline   Reply With Quote
Old 23-10-2007, 02:09 AM   #8
BennyK
Registered User
 
BennyK's Avatar
 
Join Date: Oct 2007
Location: IL
Posts: 738
Thanks: 0
Thanked 3 Times in 3 Posts
Cool After much hard work:

This is my custom shelf:
Attached Thumbnails
Click image for larger version

Name:	myshelf.jpg
Views:	1396
Size:	14.3 KB
ID:	36806  
BennyK is offline   Reply With Quote
Old 23-10-2007, 02:10 AM   #9
BennyK
Registered User
 
BennyK's Avatar
 
Join Date: Oct 2007
Location: IL
Posts: 738
Thanks: 0
Thanked 3 Times in 3 Posts
Default

And it's code:
Fell free to copy anything you want
Attached Files
File Type: mel shelf_modeling.mel (15.4 KB, 54 views)
BennyK 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.