Maya for 3D Printing - Rapid Prototyping
In this course we're going to look at something a little different, creating technically accurate 3D printed parts.
# 1 30-08-2008 , 01:52 AM
Registered User
Join Date: Aug 2008
Posts: 4

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!!

# 2 30-08-2008 , 02:27 AM
BennyK's Avatar
Registered User
Join Date: Oct 2007
Location: IL
Posts: 738
Here's a thread of mine that might answer some of your questions:
https://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


When in doubt, delete history and freeze transformations.

My latest snake game
(Requires DirectX9 SDK and Framework)
# 3 30-08-2008 , 02:44 AM
Gen's Avatar
Super Moderator
Join Date: Dec 2006
Location: South FL
Posts: 3,522
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.


- Genny
__________________
::|| My CG Blog ||::
::|| My Maya FAQ ||::
# 4 30-08-2008 , 03:11 AM
Registered User
Join Date: Aug 2008
Posts: 4
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!!

# 5 30-08-2008 , 03:30 AM
Gen's Avatar
Super Moderator
Join Date: Dec 2006
Location: South FL
Posts: 3,522
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.


- Genny
__________________
::|| My CG Blog ||::
::|| My Maya FAQ ||::
# 6 30-08-2008 , 06:13 AM
Chirone's Avatar
Subscriber
Join Date: Dec 2007
Location: NZ
Posts: 3,125
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




that's a "Ch" pronounced as a "K"

Computer skills I should have:
Objective C, C#, Java, MEL. Python, C++, XML, JavaScript, XSLT, HTML, SQL, CSS, FXScript, Clips, SOAR, ActionScript, OpenGL, DirectX
Maya, XSI, Photoshop, AfterEffects, Motion, Illustrator, Flash, Swift3D
# 7 30-08-2008 , 06:34 AM
Gen's Avatar
Super Moderator
Join Date: Dec 2006
Location: South FL
Posts: 3,522

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.


- Genny
__________________
::|| My CG Blog ||::
::|| My Maya FAQ ||::
# 8 30-08-2008 , 10:11 AM
Chirone's Avatar
Subscriber
Join Date: Dec 2007
Location: NZ
Posts: 3,125
and your pink layout user added image




that's a "Ch" pronounced as a "K"

Computer skills I should have:
Objective C, C#, Java, MEL. Python, C++, XML, JavaScript, XSLT, HTML, SQL, CSS, FXScript, Clips, SOAR, ActionScript, OpenGL, DirectX
Maya, XSI, Photoshop, AfterEffects, Motion, Illustrator, Flash, Swift3D
# 9 01-09-2008 , 09:30 AM
gster123's Avatar
Moderator
Join Date: May 2005
Location: Manchester Uk
Posts: 6,300
yeah you can use if statements no probs with MEL.


"No pressure, no diamonds" Thomas Carlyle
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