Simply Maya User Community

Simply Maya User Community (https://simplymaya.com/forum/index.php)
-   Maya Basics & Newbie Lounge (https://simplymaya.com/forum/forumdisplay.php?f=31)
-   -   Need Help Creating Shelf with "Show" Options (https://simplymaya.com/forum/showthread.php?t=30804)

Chozopuffs 30-08-2008 01:52 AM

Need Help Creating Shelf with "Show" Options
 
Hi SimplyMaya board, new here looking for a bit of help. I searched using keyword "shelf" for this question but did not see a thread appear (though I found a few fun ones) that answers this question.

I want to make a shelf for the "Show" options that appear in the "Pane Specific Menu" bar. I don't know if I'm phrasing that right, but you know... I want the ability to click a button on my custom shelf and hide/show in my layout "polygons" and "locators" and "lights" and "joints"... a separate button for each and so on and so forth...

I'd imagine this useful and am surprised I haven't found it on the web yet despite a few hours of scouring. I guess I'm not using the right terminology.

Anyway, if someone can help, by either posting a link to the answer of this question or a download for it or explanation or something, that would be great. Please use simple/specific terminology as my Maya knowledge is not too great at this time... but I'm hoping to change that :p

Thank you very much!!

BennyK 30-08-2008 02:27 AM

Here's a thread of mine that might answer some of your questions:
http://forum.simplymaya.com/showthre...threadid=27902

To create a shelf button for a specific action you can use the Mel script that calls it (which you can find in the script editor after preforming the action)

Hope this helps,
Benny

Gen 30-08-2008 02:44 AM

I see what you mean. In this case, lets say you only want to see polygons.

Well you can go to the script editor (the little button on the bottom right of the command line). Under 'History' turn on, 'Echo All Commands'. Keep that window open. In the main menus go to Display >Hide All(this will affect all the cameras). Go back to the script editor and copy paste or highlight then middle mouse drag (doesnt matter) the 'HideAll;' line into the MEL input panel below. Back up to Display>Show>Show Geometry>Polygon Surfaces. In the Script Editor copy the 'hideShow -polySurfaces -show;' portion onto the second line of the Mel Input pane, highlight the new script and middle mouse drag that onto a shelf, give it a name. You might want to create a 'ToggleShowAll;' script and put that in your shelf also. If you only want it to affect a particular camera then you'd have to have that view active and use the info from "Show" instead of "Display".

I'm pretty sure there's a more efficient way of doing this if you know scripting.

Chozopuffs 30-08-2008 03:11 AM

hey thanks for some replies! Okay... I read and tried those suggestions, I didn't quite get it to do what I want but I got something out of this so far, but it's not quite right yet...

I opened script editor, cleared all, put on the echo all commands...

I went to "show" in the window pane (which has every option on), and deselected "polygons"... the editor updated, I copied the crazy looking line...

modelEditor -e -polymeshes 0 modelPanel4;

and pasted it into the bottom half... then I dragged selected over that and middle mouse button dragged it into my shelf. It created a button...

However that new button only hides Polygons... clicking it again doesn't bring them back.

Now I see I can create a second button to bring them back, but that kinda defeats the purpose... so I guess that's what I'm up to, what do I have to add in to tell that button to act as a toggle on/off command?

Thanks!!

Gen 30-08-2008 03:30 AM

If you have everything showing already and you choose polygons of course its going to hide polygons and show everything else. This is why I say, choose to hide everything first, everything will be unchecked (this is the first part of the script) then you then show polygons (thats the second part), only polys will be displayed, all that is one script. Then you can type in, "showHidden -all;" (of course no quotes) and make a shelf button out of that as well. So now you have 2 buttons, one to show only polys and another to bring back everything else.

Chirone 30-08-2008 06:13 AM

your solution will still use two buttons though, GecT?

he wants a button that toggles on and off hide-polygons

the first thing i can think of is to use an if-statement
if polygons not visible
then show polygons
else hide them

but, i don't know what scripting languages can do yet

what i suggest is finding a script that toggles something and seeing if you can steal any of that code

there's a script on highend3d, i think, that toggles xray mode. it might contain a solution or inspiration to get that hide/show-polygon button you're after

Gen 30-08-2008 06:34 AM

Quote:

Originally posted by Chirone
your solution will still use two buttons though, GecT?

he wants a button that toggles on and off hide-polygons

the first thing i can think of is to use an if-statement
if polygons not visible
then show polygons
else hide them

but, i don't know what scripting languages can do yet

what i suggest is finding a script that toggles something and seeing if you can steal any of that code

there's a script on highend3d, i think, that toggles xray mode. it might contain a solution or inspiration to get that hide/show-polygon button you're after

Yeah it will, he can use that work around, get lucky and find something on the net, or learn scripting. Personally I'm not a big fan of the shelf and all that clutter, I prefer marking menues and hotkeys.

Chirone 30-08-2008 10:11 AM

and your pink layout ;)

gster123 01-09-2008 09:30 AM

yeah you can use if statements no probs with MEL.


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

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