Beer glass scene creation
This course contains a little bit of everything with modeling, UVing, texturing and dynamics in Maya, as well as compositing multilayered EXR's in Photoshop.
# 1 20-10-2007 , 05:22 PM
BennyK's Avatar
Registered User
Join Date: Oct 2007
Location: IL
Posts: 738

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

# 2 20-10-2007 , 06:13 PM
t1ck135's Avatar
Registered User
Join Date: May 2004
Location: UK
Posts: 1,991
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.
# 3 21-10-2007 , 03:18 AM
BennyK's Avatar
Registered User
Join Date: Oct 2007
Location: IL
Posts: 738
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

# 4 21-10-2007 , 09:01 AM
BennyK's Avatar
Registered User
Join Date: Oct 2007
Location: IL
Posts: 738
I found a way to copy a button but it doesn't work everywhere user added image - 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?

# 5 21-10-2007 , 09:17 AM
BennyK's Avatar
Registered User
Join Date: Oct 2007
Location: IL
Posts: 738
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 user added image .
Thanks in advance,
Benny

# 6 22-10-2007 , 01:53 AM
t1ck135's Avatar
Registered User
Join Date: May 2004
Location: UK
Posts: 1,991
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 user added image
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.
# 7 22-10-2007 , 03:57 AM
BennyK's Avatar
Registered User
Join Date: Oct 2007
Location: IL
Posts: 738

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

# 8 23-10-2007 , 02:09 AM
BennyK's Avatar
Registered User
Join Date: Oct 2007
Location: IL
Posts: 738

After much hard work:

This is my custom shelf:

Attached Images
# 9 23-10-2007 , 02:10 AM
BennyK's Avatar
Registered User
Join Date: Oct 2007
Location: IL
Posts: 738
And it's code:
Fell free to copy anything you want

Attached Files
File Type: mel shelf_modeling.mel (15.4 KB, 480 views)
Posting Rules Forum Rules
You may not post new threads | You may not post replies | You may not post attachments | You may not edit your posts | BB code is On | Smilies are On | [IMG] code is On | HTML code is Off

Similar Threads