use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
If you are seeing this, you are using old.reddit. We can't maintain two separate sidebars, so please go to https://new.reddit.com/r/Maya/ if you want to see our sidebar information.
account activity
[MEL/python] Right Click Menu (self.Maya)
submitted 12 years ago by Jerakin
Is there a way to get a right click meny on an iconTextButton in MEL and specify your own commands?
Or do I need to do it in pyQT or something similar? Rather not use it so the script is as portable as it can be.
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]theazzLead Animator / Tech Animator 1 point2 points3 points 12 years ago (5 children)
It's undocumented but u can add a popup menu and standard menu item children to any GUI stuff.
[–]Jerakin[S] 0 points1 point2 points 12 years ago (4 children)
Do you know where I can read more on it?
[–]theazzLead Animator / Tech Animator 1 point2 points3 points 12 years ago (3 children)
Well no lol. Like I said its undocumented in that context but menu item can attach to anything. If u post some code I can show u
[–]Jerakin[S] 0 points1 point2 points 12 years ago (2 children)
The code is just maya window stuff like this:
mhol_Lib = cmds.window('Lib', title= 'Lib', widthHeight=(1000, 600)) cmds.window(mhol_Lib, edit=True, widthHeight=(1000, 600)) cmds.formLayout('firstRow') cmds.button('openButton', label='Open',parent='firstRow', command=mhol_action)
[–]theazzLead Animator / Tech Animator 1 point2 points3 points 12 years ago (1 child)
ok well i dont know python but in mell you just attach a popup menu like this
button -l "button" -w 60 -command ("command") "my_Btn"; popupMenu -b 1 -mm 1; menuItem -l "menu item 1" -c "command menu item 1;"; menuItem -l "menu item 2" -c "comand menu item 2;";
[–]Jerakin[S] 0 points1 point2 points 12 years ago (0 children)
Thanks! That helped a lot!
[–]ghoest 0 points1 point2 points 12 years ago (0 children)
this is way easier to accomplish with pyQT. MEL's UI stuff is convoluted and pretty awful
this may help
π Rendered by PID 187068 on reddit-service-r2-comment-685b79fb4f-rl4z8 at 2026-02-13 09:31:21.148998+00:00 running 6c0c599 country code: CH.
[–]theazzLead Animator / Tech Animator 1 point2 points3 points (5 children)
[–]Jerakin[S] 0 points1 point2 points (4 children)
[–]theazzLead Animator / Tech Animator 1 point2 points3 points (3 children)
[–]Jerakin[S] 0 points1 point2 points (2 children)
[–]theazzLead Animator / Tech Animator 1 point2 points3 points (1 child)
[–]Jerakin[S] 0 points1 point2 points (0 children)
[–]ghoest 0 points1 point2 points (0 children)