Creating/Removing Menu itesm
Hi
I am using the following script from the help to create a new menu item:-
if menuMan.registerMenuContext 0x246c6dbe then ( local mainMenuBar = menuMan.getMainMenuBar() local helpMenuIndex = mainMenuBar.numItems() local helpMenuItem = mainMenuBar.getItem(helpMenuIndex) local helpMenu = helpMenuItem.getSubMenu() local sepItem = menuMan.createSeparatorItem() local testItem = menuMan.createActionItem "MyTest" "Menu Test" helpMenu.addItem sepItem -1 helpMenu.addItem testItem -1 menuMan.updateMenuBar() )
Now what I want to do is write a script to remove this Menu. In the help it appears that you use unregister, but it then warns you to use extreme caution as you might corrupt your 3ds Max installation. Can anyone help?
Thanks
Gray
Comments
the MenuContext? subMenu? if
the MenuContext?
subMenu?
if so use something along the lines of:
try (menuMan.unRegisterMenu (menuMan.findMenu "SubMenuName") ) catch()
Raphael Steves
Thanks Graph I just ment was
Thanks Graph
I just ment was it possible to unregister the unique code that was created by the following line?
if menuMan.registerMenuContext 0x246c6dbe then
When you create a menu this way as in the help than you need to create a new code every time you run the script to add the menu. Anyway I have just skipped out this line and I can now add and remove menus easily.
Ta
G
heres what i use: local
heres what i use:
getToolsMenu returns the mainMenu/tools submenu mixinInterface
you gotta update on every iteration in case theres freakishly more than one entry
could also use a while loop tho
Raphael Steves
Cool, that will work,
Cool, that will work, thanks.
I have also been trying to Unregister the MenuContext. I dont think it is possible though.
Anyone got any ideas? Most people seem not to use them anyway!
Thanks
G