CGTalk > Software > Autodesk Maya
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 09-08-2013, 11:16 AM   #1
otuama
Expert
 
otuama's Avatar
portfolio
Sean Toomey
Swansea, United Kingdom
 
Join Date: Apr 2007
Posts: 225
Button Menu

Hi all.

In a menuset, instead of having a button which opens a menu, is it possible to have a button to just run a command?

For example, I have a button next to the help menu. When I press the button it doesn't open a drop down menu but runs a command that opens a GUI.

Ta
 
Old 09-08-2013, 02:02 PM   #2
BigRoyNL
TD/animator @ Colorbleed
 
BigRoyNL's Avatar
portfolio
Roy Nieterau
Technical Director / Animator
Colorbleed
Utrecht, NL
 
Join Date: Feb 2005
Posts: 212
Send a message via MSN to BigRoyNL
Just hook up a command to the postMenuCommand and add no menuItems. The command will be called whenever you click the menu, but nothing gets shown. The command can then of course generate and show the UI.

Code:
import maya.cmds as mc def myFunc(*args): print 'Create your GUI here' print 'These are the arguments that Maya passes by default: ', args mc.window( menuBar=True, width=200 ) mc.menu( 'Click me', pmc=myFunc ) mc.showWindow()
 
Old 09-08-2013, 04:05 PM   #3
otuama
Expert
 
otuama's Avatar
portfolio
Sean Toomey
Swansea, United Kingdom
 
Join Date: Apr 2007
Posts: 225
Ok, thanks.

What I should have said is that I'd like this in the main maya UI.

So, I presume I need to make a file in the scripts > startup folder. Then, maybe edit the menuSetPrefs.mel file to load in the file.
 
Old 09-11-2013, 08:39 PM   #4
yubi
New Member
portfolio
yuval gofer
freelance
kibbutz hagoshrim 12, IL
 
Join Date: Mar 2012
Posts: 1
error;

hi all
i'm six years experiance maya and yesturday i've face this wierd errore:// Error: displayString identifier "m_FileMenu.kProjectWindow" does not exist.

in the buttom line maya can't show up the project menu - file - project -set
new etc..
can someone now this ??
need help
thanks
 
Old 09-11-2013, 08:39 PM   #5
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,481
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 06:58 AM.


Powered by vBulletin
Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.