[Closed] MenuMan Question?
Hey guys,
I’ve just discovered the methods for getting all the menus and menu items within Max, but my problem is that I can’t find some sort of mechanism to execute the ‘leaf’ menu items. I can traverse the path down the Main Menu Bar > Create > Standard Primitives > Box, but I can’t actually execute the Box creation process…?
Is this actually possible with maxscript? Am I missing the plot? Will Jack and Kate make it before the island’s security system gets them?
Thanks for any help guys.
PS. You guys should probably ignore that last question…
Hey Wahooney,
You are looking for something like stdprims.box(), right? I don’t think that can be done which though I believe it exists for maxscript rcmenus.
As for the last question, do you mean Lincoln 3 Echo, and Jordan 2 Delta?
Light
I want to make a system that can show menus in a different way. I have found methods to get all the menus and menu items in their hierarchies but I can’t find a way to execute them.
I’m not quite sure I understand what you’re after because MenuMan is there for access to the Menu system to Create Menu Items… not to Execute Menu Items. Most of the Menu Items are listed in teh Customize UI dialogs, so you can just find out what bit of command is used to access command for the actual menu items you’re interested in. MenuMan allows you to create new menu’s or edit existing ones, as far as I know… I’ve only ever used it to create customized UI setups.
Maneswar
I think I understand… you have ceated some custom menu items, but now you cannot get the item on that menu to execute? If you open the Customize UI dialog, head to Menu’s tab, open a menu item you want to compare against… you can right click teh menu items, and you should find some of them are Macroscripts… Action Items in Maxscript parlance… and you should find the way the menu actually calls a script command, which triggers the action in that script. For example Box calls a Create Box script… as below:
macroScript Box
enabledIn:#(“max”, “viz”) –pfb: 2003.12.12 added product switch
category:“Objects Primitives”
internalcategory:“Objects Primitives”
tooltip:“Box”
ButtonText:“Box”
icon:#(“standard”, 1)
(
on execute do StartObjectCreation Box
on isChecked return (mcrUtils.IsCreating Box)
)
Hope that helps.
Maneswar
Thanks, but that’s not what I really want, Maneswar.
I want to be able to find an item using Max’s menus and execute them from there, I want to be able to execute anything that appears in any menu in Max, or indeed anything that will be added to Max’s menus by a user, but the more I look into it it seems that it isn’t possible, yet.
You’d be best off taking a look at what is referenced / called as a command in the Menu Tab and Quad Tab on the Customize UI dialog… that’s where you can find the small command text that you’d want to incorporate. Basically, the name on a menu item is just graphics. The command is linked to an internal locator and a specific script / macroscript which gets executed when you select a menu item. You’d have to find out what is executed, and then find a means to link to that executed code in your interface you’re working with.
You can also simulate a lot of this by deciphering the code behind the Toobar buttons which are listed sequentially in teh CUI file, or by keeping the Maxscript Listener window open while executing various commands. Then you can cut paste the executed text to scripts that you can associate with your interface. You can similary find out which menu item represents which code by looking into the MNU file which is also sequential pretty much, but is fairly heady stuff to parse.
For example, when you go to Create > Standard Primitives > Box, you’re executing
macros.run “Objects Primitives” “Box”
So if you paste that into a script / text field where that specific text can be executed, then you’re creating a box exactly as you’d be if you used the Menu.
But you can also create a box by entering
Box()
which create a 25 unit cube by default.
You can also enter in
m = menuman.getmainmenubar()
m1 = m.getitem 6
m2 = m1.getsubmenu()
m3 = m2.getitem 1
m4 = m3.getsubmenu()
m5 = m4.getitem 1
but that’s just getting you access to the menu item in the ui files, not the actual menu action.
Hope that makes sense…
Maneswar
I need to get to the item via the menuMan.getMainMenuBar method and execute it, but that seems like it ain’t gonna work.
Thanks for the help guys, maybe it can be accessed via a plugin… hmmm…