2011年12月8日木曜日

MAXUI の menu を MAXScript で 追加する

■MaxのMenuBarにmenuをMAXScriptでついかするには
■Create menu to Max menu bar with MAX Script

CGTalkのスレッド↓
http://forums.cgsociety.org/showthread.php?t=609379


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

0 件のコメント:

コメントを投稿