The MenuMan Interface provides access to the Menu Manager and allows the user to create new and access existing menus and QuadMenus and their sub-menus and menu items as well as load, save, register and unregister them.
For details and examples of using this interface, see also the topic Menu Manager
<boolean>loadMenuFile <filename>file
This method allows you to load a menu file from disk and automatically update the UI accordingly. Returns true if the menu file was loaded, otherwise false.
<string>file: The path and filename of the menu file to load.
<boolean>saveMenuFile <filename>file
This method allows you to save a menu file to disk. Returns true if the menu file was saved, otherwise false.
<string>file: The path and filename of the menu file to save.
<string>getMenuFile()
This method returns the file name of the currently loaded and active menu file.
<Interface>findMenu <string>menuName
This method will return a pointer to a menu based on its name. Returns a menu MixinInterface to the menu or undefined if the menu was not found.
<string>menuName: The name of the menu to return.
<Interface>findQuadMenu <string>menuName
This method will return a pointer to a quad menu based on its name. Returns a quadMenu MixinInterface to the quad menu or undefined if the menu was not found.
<string>menuName: The name of the menu to return.
<integer>numMenus()
Returns the total number of menus in registered with the menu manager.
<integer>numQuadMenus()
Returns the total number of quad menus registered with the menu manager.
<Interface>getMenu <index>index
Retrieves the indexed menu in the menu manager. This is a 1-based index. Returns a menu MixinInterface.
<Interface>getQuadMenu <index>index
Retrieves the indexed quad menu in the menu manager. This is a 1-based index. Returns a quadMenu MixinInterface.
<Interface>createMenu <string>name
This method creates a new, empty menu with the given name and returns a menu MixinInterface.
<Interface>createQuadMenu <string>name <string>quad1Name <string>quad2Name <string>quad3Name <string>quad4Name
This method creates a new, empty quad menu. It contains 4 empty menus, one for each quad. Returns a quadMenu MixinInterface.
<Interface>createSubMenuItem <string>name <Interface>subMenu
This method creates a new sub-menu item that can be added to a menu. It uses the given "name" and it displays the given sub-menu. Returns a MenuItem MixinInterface.
<Interface>createSeparatorItem()
This creates a new menu separator that can be added to a menu. Returns a MenuItem MixinInterface.
<Interface>createActionItem <string>macroScriptName <string>macroScriptCategory
This method creates a new menu item that can be added to a menu. The item is an action that executes the macro script with the given name and category. Returns a MenuItem MixinInterface when successful, or "undefined" if there is no macroScript with the given name and category.
<boolean>setViewportRightClickMenu <enum>which <Interface>menu
which enums: {#nonePressed|#shiftPressed|#altPressed|#controlPressed|#shiftAndAltPressed|#shiftAndControlPressed|#controlAndAltPressed|#shiftAndAltAndControlPressed}
This method method allows you to set the viewport right-click menu to the specified quad menu. Returns true if it was set successfully.
<enum>which : See the List of Right-Click Contexts above.
<Interface>menu: A pointer to the quad menu you wish to set.
<Interface>getViewportRightClickMenu <enum>which
which enums: {#nonePressed|#shiftPressed|#altPressed|#controlPressed|#shiftAndAltPressed|#shiftAndControlPressed|#controlAndAltPressed|#shiftAndAltAndControlPressed}
This method returns a quadMenu MixinInterface to the current viewport right-click quad menu.
<enum>which: See the List of Right-Click Contexts.
<Interface>getMainMenuBar()
This method returns a menu MixinInterface to the main menu bar.
<boolean>setMainMenuBar <Interface>menu
This method allows you to set the main menu bar. Returns true if it was set successfully.
<Interface>menu: A menu MixinInterface to the menu you wish to set as the main menu bar.
<bool>getShowAllQuads <Interface>quadMenu
This method checks if the "Show All Quads" flag is set for a specific QuadMenu. This method will return true if the flag is set or false if the flag is not set.
<Interface>quadMenu: A quadMenu MixinInterface to the QuadMenu you wish to check the flag for.
<void>setShowAllQuads <Interface>quadMenu <bool>value
This method sets the "Show All Quads" flag for a specific QuadMenu.
<Interface>quadMenu : A quadMenu MixinInterface to the QuadMenu you wish to set the flag for.
<bool>value: True to set the flag to on, false to set the flag off.
<string>getQuadMenuName <Interface>quadMenu
This method returns the name given to a specific QuadMenu as a string.
<Interface>quadMenu: A quadMenu MixinInterface to the QuadMenu for which you wish to retrieve the name.
<void>setQuadMenuName <Interface>quadMenu <string>name
This method allows you to set the name of a specific QuadMenu.
<Interface>quadMenu : A quadMenu MixinInterface to the QuadMenu for which you wish to set the name.
<string>name: The string containing the name for the QuadMenu.
<void>updateMenuBar()
This method can be called to update 3ds Max’ main menu bar after adding sub-menu’s or menu items.
<boolean>registerMenuContext <integer>contextId
To add items to 3ds Max’s main menu, the plug-in should check the return value of RegisterMenuContext(), and if it is true, that means that this is the first time it has been registered, and the plug-in can then create new menus, add items to 3ds Max’s main menu and Quad menus.
<boolean>unRegisterMenu <Interface>menu
This method allows you to remove a menu form the mananger. Returns false if the menu was not registered, true if successfully unregistered.
<Interface>menu: Points to the menu to unregister.
<boolean>unRegisterQuadMenu <Interface>quadMenu
This is like "unregisterMenu" but for quad menus.
See also
Mixin Interface: menuMan.getMenu(...)
Interface: menu
Methods:
<void>setTitle <string>title
Sets the menu title to the supplied string.
<&string>getTitle()
Returns the menu title.
<integer>numItems()
Returns the number of menu items.
<Interface>getItem <index>position
Returns a menuItem MixinInterface to the indexed menu item.
<void>addItem <Interface>item <index>position
Adds a new menu item to the menu at the specified position.
<void>removeItemByPosition <index>position
Removes the indexed menu item.
<void>removeItem <Interface>item
Removes the specified menu item.
Mixin Interface: menuMan.getQuadMenu (...)
Interface: quadMenu
Methods:
<Interface>getMenu <index>position
Returns a menu MixinInterface to the indexed menu (1 to 4).
<void>trackMenu <bool>showAllQuads
When set to true, forces the quadMenu to show all quads.
Mixin Interface: menuMan.createSubMenuItem(...)
Interface: menuItem
Methods:
<void>setTitle <string>title
Sets the menu item title to the supplied string.
<&string>getTitle()
Returns the menu item title.
<bool>setUseCustomTitle <bool>value
When true is supplied, forces the menu item to show the custom title.
<bool>getUseCustomTitle()
Returns true if custom title is enabled, false otherwise.
<bool>setDisplayFlat <bool>value
When true is supplied, forces the menu item to be displayed as flat.
<bool>getDisplayFlat()
Returns true if the menu item is set to display as flat.
<bool>getIsSeparator()
Returns true if the menu item is a separator.
<Interface>getSubMenu()
Returns a menu MixinInterface to the sub-menu.
See also