Notifications
Clear all

[Closed] development toops: make the script run on start

Hi,

I have some functions I want to run at the start of 3ds max. Right now I’m doing this manually by running script like this:

macroscript Dev category:"Dev" (
		fn localPath = (
			global local_path = "he finds your local path here"
		)
		localPath()
		
		fn getDirs dir = (
			"more script stuff"
		)
		getDirs local_path
			
		fn getScripts dir = (
			"more script stuff"
		)
		getScripts local_path
)

  1. The issue is that when I run the macro from the shelf I only get the local_path variable, but none of the functions getDirs, getScripts. I need to run it from editor to have the functions as well

  2. How do I make this kind of script to run on 3dsMax start so it would be automatic?

4 Replies

put this script in one of startup directories:
…max\scripts\startup
\users<you>\AppData\Local\Autodesk\3dsMax…max\ENU\scripts\startup\

Thanks, that solves my issue #1 as well

There is an order to execution too, which is useful to know if you have scripts that depend on the functions you are defining.

http://docs.autodesk.com/3DSMAX/16/ENU/MAXScript-Help/index.html?url=files/GUID-615D14FB-0F2D-4801-B381-1128C4128C70.htm,topicNumber=d30e31633

I use a junction (easy to make with mklink) from my script library startup scripts to the stdplugs\stdscripts. That way is easy to deploy new functions and scripts, I use the same approach for macros.