Message 1 of 2
How can I add menu on menubar with Maya API?

Not applicable
09-06-2012
02:02 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Adding Menu is works like below
But, I can't add menu on menubar.
Is there any way to add menu on menubar?
import maya.OpenMayaMPx as OpenMayaMPx
mplugin = OpenMayaMPx.MFnPlugin()
mplugin.addMenuItem("polyCube", "MayaWindow|mainEditMenu", "polyCube", "")
But, I can't add menu on menubar.
import maya.OpenMayaMPx as OpenMayaMPx
mplugin = OpenMayaMPx.MFnPlugin()
mplugin.addMenuItem("polyCube", "MayaWindow", "polyCube", "")
// Error: line 1: menu: Object 'MayaWindow' not found. //
# Error: RuntimeError: file c:\buildforge\Maya_2013_Win64\build\wrk\optim\runTime\Python\Lib\site-packages\maya\OpenMayaMPx.py line 146: (kFailure): Unexpected Internal Failure #
Is there any way to add menu on menubar?