Notifications
Clear all

[Closed] Customise user interface

Hi

I have noticed that after Max has been installed for a while it takes forever to open the Customize User Interface window (where all the quads and keyboard short cuts are). The screen fades to white as it becomes unresponsive and i have to wait about 5 minutes for it to open!

has anyone seen this before or got a solution for this? I do a lot of scripting and imports into Max and im wondering if there is a file that max is just constantly adding stuff to so its got massive and as such takes forever to read?

Any help would be massively appreciated

Dave

7 Replies

do you have Havok installed in you system?

ok. here is a thing. Havok, Physics, and Cloth as you know force creating their toolbars in max UI.
probably they use the same mechanism of doing it, and it’s wrong(!). because of that every time you open max they make a new record in mnu (now it’s mnux) file.
you can try to open currently used by your system menu file and check how many records of
“Cloth”, “Havok Content Tools”, “Help”, and “Physics”…
the absolute record i’ve seen was ~220,000 items. you probably have a chance to break it

to open the menu file in the script editor:

edit (menuMan.getMenuFile())

oh man that file is a mess!

i have references to my works script categories and menu items over 22000 times!

just deleting (cutting out to make a backup) the entire Usersave folder made the customize window open immediately so thanks for that! The new save file is 237Kb where the old one was 7Mb of xml, now wonder it was taking a lone time

I did a quick test and upon restart of Max it added another reference to it so this file is going to be cluttered with mess over time.
Why would it be adding my user scripts multiple times?

all im doing is a fileIn on boot of max so the users have the latest scripts, this cannot be why, or how would you ever update a script?

1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

does the system add anything related to your scripts every time you load them? i don’t think so. the system adds cloth, havok, and physicx menu items data

Oh – yes. those clever little scripts and plugins which autocreate menu entries on max launch. Nvidia’s PhysX startup scripts did that if you removed your Physx mainmenu entry – propably they still do:
They create a menu entry each launch over and over again. It only does’nt occure with MassFX ( which is PhysX essentially) because it’s menu is’nt placed in the top level main menu and one usually does’nt rearrange the standard menue’S subelvels …

And all Max Design users and now Max 2016 users ( because of the merge) beware :
Civil View’s startup script looks for the “Civil view” menu entry on a specific position in the main menu. If it’s not found there, it recreates it’s menu structures over and over again leading to multiple “Civil View” entries in your mnux. Really great when you have a customized main menu with added menues at the end …
The only way to fix is either editing it’s startup script, removeing them from the startup folders or remove civil view alltogether
The relevant script parts would be so easy to fix, similar to the pseudo code below

if ( menuMan.findMenu “Civil View” == undefined ) then
(
– sems like the first run
– create menu structure like before, add created menu to the mainMenu
mainMenubar.addItem <newCivilViewMenu>( mainMenubar.numItems() – 1 )
)
else – LEAVE MAINMENU STRUCTURE ALONE , DONT MESS WITH CUSTOMIZED USER INTERFACES

I reported the Civil view bug, maybe it would be good if more people do the same
Considering how long Civil View is already shipping with Max Design ( and now with 3ds Max ), it makes me wonder how many people have bloated menue files, just because of that one flaw…

Here’s my menu structure at the point i found out about this Civil view flaw, over 100 Civil view entris …

Hey Denis,

Could you elaborate on the correct method of updating menus?
We have a script that creates a menu for our in house tools.
As they change constantly, either added or removed, we build the menu on startup and remove it on shutdown, yet the mnux file is still updated with the removed menu.

After much trial and error, here is a python function that will remove a menu and all it’s sub menu’s, resulting in a non-polluted .mnux file:


from pymxs import runtime as mxRt
def remove_AllItemsFromMenu(inMenu, removeTopMenu=False):
   """
      Rercursively remove all items and sub items from the givem menu.
   """
   
   menuCount = inMenu.numItems()
   for menuIndex in reversed(xrange(1, menuCount + 1)):

      menu    = inMenu.getItem(menuIndex)
      subMenu = menu.getSubMenu()
      if subMenu:

         remove_AllItemsFromMenu(subMenu, removeTopMenu=True)

      inMenu.removeItem(menu)
   if removeTopMenu:

      mxRt.menuMan.unRegisterMenu(inMenu)

   return mxRt.menuMan.updateMenuBar()

usage:


# Requires a menu called "TestMenu" to exist:
menu = mxRt.menuMan.findMenu("TestMenu")
remove_AllItemsFromMenu(menu)

Hopefully this well help someone else fighting through the super low level menu api.