I am trying to build a custom menu in maya.
google groups has this code and it shows that it works but when i try it does not show in menu bar for me. I have tried for hours. What else is required for it to show in menu. IOW why does it not show in maya menu bar.
https://groups.google.com/g/python_inside_maya/c/XqM7Rkm2kOE
import pymel.core as pm
# Name of the global variable for the Maya window
MainMayaWindow = pm.language.melGlobals['gMainWindow']
# Build a menu and parent underthe Maya Window
customMenu = pm.menu('Custom Menu', parent=MainMayaWindow)
# Build a menu item and parent under the 'customMenu'
pm.menuItem(label="menu item 'hihi'", command="print 'hihi'", parent=customMenu)
edit : when querying menus it does show it in the list
maya_main_window = mel.eval("$tmpVar = $gMainWindow")
menus = cmds.window(maya_main_window, query=True, menuArray=True)
for menu in menus:
print menu
source https://stackoverflow.com/questions/70099360/maya-custom-menu-is-not-showing-on-menu-bar
Comments
Post a Comment