Button Menu

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Search this Thread Display Modes
  09 September 2013
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.

  09 September 2013
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.

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 )
  09 September 2013
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.
  09 September 2013

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
  09 September 2013
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

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
Society of Digital Artists

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

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

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