MAXSCRIPT: Dynamic menu without macroscripts

Hello,

Is there any way in maxscript to generate menu items without using macroscripts ? I have a wrapper to 3dsmax that uses a custom startup script and I am building my menus in there, but I don’t want this process to save any macrosripts in the APPDATA folder.

I see that in the python menu example, there is a way to add an action without creating a macroscript :

http://help.autodesk.com/view/3DSMAX/2016/ENU//?guid=__py_ref_demo_menu_8py_example_html (line 22) (Not sure if this creates a macroscript underneath)

Can i do the same thing with maxscript ? Is there an alternative way of adding menuitems to menuMan.createActionItem ?

Thanks!

There’s no simple way that I know of. Btw. not sure if it’s just my max install, when I uncommented the unregister menu part of the python demo, just hovering over manubar made max crash to desktop.

You could probably open an modify the XAML ribbon file using Markup.XamlReader and reload the modified file with MaxRibbon.LoadRibbonConfig. There you can directly specify MAXScript commands:

<wpfmax:MaxscriptCommand Maxscript=<string>Expression MaxscriptToggleOff=<string>OffExpression />

The closest thing would be a macroscript that uses filein to load your scripts from wherever.

macroScript MyTool category:"Mytools"
			(
				filein @"C:\Path\To\My\Tools\mytool.ms"
			)

That way you can at least not have your base code lying in APPDATA

In fact you can even script the creation of the needed macro scripts by building strings and using execute()
That’s how I build my menus (I hate digging in APPDATA for my code)

[QUOTE=Mambo4;28985]The closest thing would be a macroscript that uses filein to load your scripts from wherever.

macroScript MyTool category:"Mytools"
			(
				filein @"C:\Path\To\My\Tools\mytool.ms"
			)

That way you can at least not have your base code lying in APPDATA

In fact you can even script the creation of the needed macro scripts by building strings and using execute()
That’s how I build my menus (I hate digging in APPDATA for my code)[/QUOTE]

That’s actually what I do right now. I just wanted to keep things cleaner, it seems like Max isn’t very friendly when it comes to that.

thanks everyone!