Simply Maya User Community

Simply Maya User Community (https://simplymaya.com/forum/index.php)
-   Programming (https://simplymaya.com/forum/forumdisplay.php?f=32)
-   -   Apply Maya's Images onto a Shelf Button (https://simplymaya.com/forum/showthread.php?t=27902)

BennyK 20-10-2007 05:22 PM

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

t1ck135 20-10-2007 06:13 PM

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

BennyK 21-10-2007 03:18 AM

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 21-10-2007 09:01 AM

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 21-10-2007 09:17 AM

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

t1ck135 22-10-2007 01:53 AM

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

BennyK 22-10-2007 03:57 AM

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 23-10-2007 02:09 AM

After much hard work:
 
1 Attachment(s)
This is my custom shelf:

BennyK 23-10-2007 02:10 AM

1 Attachment(s)
And it's code:
Fell free to copy anything you want


All times are GMT. The time now is 12:59 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Simply Maya 2018