Menu Manager

The menu manager API lets plugins register menus and menu contexts that are saved in 3ds Max's menus customization file (found at [MaxInstallDirectory]\[Language]\UI\DefaultUI.mnux for the default UI) , and can be configured by the user.

Menus are populated with action items published from action tables. Menu contexts are places where menus can appear in 3ds Max's UI. Menu contexts can be either for the main menu bar, or for places where a quad menu can be displayed. 3ds Max ships with a few pre-defined menu contexts, including the main menu bar, the viewport quad menu and the active shade quad menu. Only a single menu-bar context is allowed, but plugins may register new quad menu context as appropriate. For example, the UVW Unwrap plug-in in the 3ds Max SDK defines a quad menu context that is used when the user right-clicks in the UVW Unwrap window.

Menu creation is handled with the IMenu API defined in the iMenus.h header. Projects using this header must link against menus.lib.

Custom menus added to 3ds Max using the IMenu API become part of the current user's local .mnux definition file, and will persist between sessions if the plug-in does not remove it. It is up to the plug-in developer to decide whether to remove the menu on exit. Plug-ins that do not do this should check whether the menu exists on start-up before creating it.

Sample Code

Examples of Action Table API's in use are found in many places in the SDK. One example is /maxsdk/samples/modifiers/ffd. Another simple example of how to hook up your own ActionTables to a custom menu is located in maxsdk/howto/ui/maxmenudemo.