Maya Training

Introduction to Hard Surface Modeling

Maya Training

Interiors and Furniture Vol 1 & 2 - Modeling & Cloth

Maya Training

Shading, Lighting and Rendering the Bedroom in MR

Maya Training

Robot volume one - Modeling with animation in mind

Maya Training

Spach-Alspaugh House the complete courseware

Maya Training

Burt The Cartoon Dinosaur Vol 01 - Modeling

New Maya Training

Robot Volume 02 - Hybrid Rigging
You are here > Home > SimplyMaya Community Forums
Loading

Welcome to Simply Maya

Please Sign in or Sign up for an account

Member Login

Lost your password?

Not a member yet? Sign Up!

Old 30-08-2008, 02:52 AM   #1
Chozopuffs
Registered User
 
Join Date: Aug 2008
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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!!
Chozopuffs is offline   Reply With Quote
Old 30-08-2008, 03:27 AM   #2
BennyK
Registered User
 
BennyK's Avatar
 
Join Date: Oct 2007
Location: IL
Posts: 738
Thanks: 0
Thanked 3 Times in 3 Posts
Default

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
__________________
When in doubt, delete history and freeze transformations.

My latest snake game
(Requires DirectX9 SDK and Framework)
BennyK is offline   Reply With Quote
Old 30-08-2008, 03:44 AM   #3
Gen
Moderator
 
Gen's Avatar
 
Join Date: Dec 2006
Location: South FL
Posts: 3,457
Thanks: 13
Thanked 635 Times in 558 Posts
Default

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.
Gen is offline   Reply With Quote
Old 30-08-2008, 04:11 AM   #4
Chozopuffs
Registered User
 
Join Date: Aug 2008
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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!!
Chozopuffs is offline   Reply With Quote
Old 30-08-2008, 04:30 AM   #5
Gen
Moderator
 
Gen's Avatar
 
Join Date: Dec 2006
Location: South FL
Posts: 3,457
Thanks: 13
Thanked 635 Times in 558 Posts
Default

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.
Gen is offline   Reply With Quote
Old 30-08-2008, 07:13 AM   #6
Chirone
Subscriber
 
Chirone's Avatar
 
Join Date: Dec 2007
Location: NZ
Posts: 3,124
Thanks: 11
Thanked 147 Times in 143 Posts
Default

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
Chirone is offline   Reply With Quote
Old 30-08-2008, 07:34 AM   #7
Gen
Moderator
 
Gen's Avatar
 
Join Date: Dec 2006
Location: South FL
Posts: 3,457
Thanks: 13
Thanked 635 Times in 558 Posts
Default

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.
Gen is offline   Reply With Quote
Old 30-08-2008, 11:11 AM   #8
Chirone
Subscriber
 
Chirone's Avatar
 
Join Date: Dec 2007
Location: NZ
Posts: 3,124
Thanks: 11
Thanked 147 Times in 143 Posts
Default

and your pink layout
__________________


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
Chirone is offline   Reply With Quote
Old 01-09-2008, 10:30 AM   #9
gster123
Moderator
 
gster123's Avatar
 
Join Date: May 2005
Location: Manchester Uk
Posts: 6,300
Thanks: 1
Thanked 51 Times in 45 Posts
Default

yeah you can use if statements no probs with MEL.
__________________
"No pressure, no diamonds" Thomas Carlyle
gster123 is offline   Reply With Quote

A little bit about who we are
Links you might find useful
Catch up with SimplyMaya
SimplyMaya specialises in Maya tutorials. We offer over 1,000 individual Maya training videos, ranging from basic Maya tutorials through to intermediate Maya tutorials. Our tutorials are created by instructors with industry experience and are designed to get you up and running in Maya quickly without making it seem like hard work.

Copyright © 1999-2015 SimplyMaya - vBulletin® Copyright © 2000-2015, Jelsoft Enterprises Ltd.