Notifications
Clear all

[Closed] How do I create my own menus inside 3dsmax interface?

 vij

Hi

Say, I have a script a.ms
How do I set things up such that I can make my own menu in 3dsmax with the title ‘customMenu’ and get my maxscript named a.ms to function via a menuItem inside ‘custom menu’

Basically I need my custom menu inside of 3dsmax.
This is pretty easy with mel…Can this be done via maxscript too?
Pl help.

6 Replies
1 Reply
(@bobo)
Joined: 11 months ago

Posts: 0

The question can be read differently depending on the level of knowledge you have or want to acquire.
Do you want to CREATE the menu itself using a MAXScript, or just create a menu item that can be placed on a menu manually? In the latter case, ‘thatoneguy’ already answered.
You can also select any code you have a drag it to a toolbar Maya-style and a new MacroScript will be created with a default script icon and the basic MacroScript() body inserted around your code. You may NOT drag a code snippet already containing the MacroScript() definition as macro bodies cannot be nested.

If you asked about building Menus via MAXScript, there is a whole MenuMan Interface documented in the MAXScript Reference that provides access to the menu system for procedurally creating new menus, menu items and changing existing ones. But this is relatively advanced matter if you are just starting with MAXScript.

Manual Method:

  1. Make your *.ms a macroscript (macroscript <name> etc etc etc) and install it.
  2. Menu Bar: Customize -> Customize User Interface
  3. Tab: “Menus”
  4. Button: “New”
  5. “Custom Menu”
  6. Drag and drop from macroscripts on the left side into list on the right.

Startup Script Method:

  1. Ask Zeboxx I actually don’t know but I know brazil has a BrMax menu created through it startup script so I know he’ll know.
    1B) Read up on “Menu Manager” in the MaxScript Documentation.

All scripts have to be a macroscript if you want to use them as a UI element anywhere in max. It’s very simple just read up on them in “macroscript” entry in the maxscript documentation.

 vij

You mean I need to write a really involved script to be able to place a menu in the max interface…Cant I get one menu named “Mymenu” inside of 3dsMax using maxscript easily. Geez mel could do it so easily in Maya. Anyways thanks bobo.

1 Reply
(@bobo)
Joined: 11 months ago

Posts: 0

No, not really involved script, but not something for the first day of scripting, either.
Please don’t give me this “easy in Maya” stuff, I really hate that – it depends on the scripter how easy it is, not on the language

macroScript PutMeOnAMenu category:"Forum Help" --some macro script
(
	print "I do nothing, but I am on a Menu!"
)

theMainMenu = menuMan.getMainMenuBar() --get the main menu bar
theMenu = menuMan.createMenu "Forum Help" --create a menu called Forum Help
theSubMenu = menuMan.createSubMenuItem "Forum Help" theMenu --create a SubMenuItem
theMainMenu.addItem theSubMenu (theMainMenu.numItems()+1) --add the SubMenu to the Main Menu
theAction = menuMan.createActionItem "PutMeOnAMenu" "Forum Help" --create an ActionItem from the MacroScript
theMenu.addItem theAction (theMenu.numItems()+1) --add the ActionItem to the menu
menuMan.updateMenuBar() --update the menu bar

Note that this script will create a NEW entry each time you run it. There are good ways to avoid this – the Help shows a very similar example with using a menu context with a unique ID which can be used to redefine existing menus instead of creating new ones, or you could simply check the names of menus and items already there and act accordingly.

You can also customize the text displayed by the item (instead of the default name of the Macro) and so on.

But while not exactly rocket science, I don’t feel this is matter for MAXScript beginners.

 vij

Thanks Bobo.

Honestly unless you’re doing a studio wide rollout where lots of people are going to need to install the script the “so easily” solution is to do it manually through customize interface interface. That’s how I always customized the hotbox in maya too.

A general rule of thumb is that people don’t like other people messing with their interface so I only use auto-install functionality in extreme circumstances or in places where I’ve been tasked with pipeline deployment tools that are mandatory and won’t interfere with what people already have.