Extending 3ds Max's Default Menus
 
 
 

A plug-in can use a MenuContext to register new menu items on to 3ds Max's default menu bar or quad menus. Since 3ds Max gets its menu configuration from a file plug-ins should only register their extensions a single time. To determine if the menu extensions have been registered yet, the plug-in should register a menu context using the ImenuManager::RegisterMenuContext() method. This method will return false if the context has not been registered, and true if it has. After the context is registered, it is saved in the menu file, and the next time 3ds Max starts, the call to RegisterMenuContext()will return false.

When adding 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. In this case the MenuContext is used only as a place holder for determining when to add items to menus, not as a place where menus can appear.

Plug-ins can also register quad menu contexts to be used as places quad menus can appear in their UI. Typically this only applies if the plug-in creates its own floating window, such as UVW Unwrap. Normally, a plug-in just needs to register action items, and possibly add items to 3ds Max's main menu or default menus.

Once items have been added to menus, and new menus have been registered, they will appear in 3ds Max's menu customization dialogs. Users can then move the items around, or remove them from menus.

If a plugin wants to add menus and items to 3ds Max's existing menus, or create its own quad menu context, it should be done when 3ds Max starts. This is best done with a global utility plugin (GUP). These plug-ins have a GUP::Start(), method that is called when 3ds Max's first starts up. It is in that method that plugins should register new contexts and add menus and items.