MaxScript Embedded Paths??

MaxScript Embedded Paths??

Anonymous
Not applicable
318 Views
3 Replies
Message 1 of 4

MaxScript Embedded Paths??

Anonymous
Not applicable
Hi all!
Based on what I have seen, it appears that the PATH to a particular piece of maxscript (such as custom attributes) actually gets stored in the .max file itself. The result is that if I move the script to a different directory, then when I load the .max file, it can't find it.

How do I change the script path that's stored in the .max file itself?

Thanks!
Andrew
0 Likes
319 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
Anyone???????

I'm still having this problem....is anyone else?


Andrew
0 Likes
Message 3 of 4

bhnh
Advocate
Advocate
Hi, Andrew. Generally, if you want a script to launch with Max you'd save it in the Startup folder in the Max folder of your C drive. You can also do the following:

- Launch Max and open the script from wherever you've got it stored.
- Select all the text in the Script Editor.
- Drag the selected text onto the main toolbar.

This creates a Macro button which launches the script wherever it's located. If you right-click the Macro button and click "Customize", you can create a keyboard shortcut to it, even if you subsequently delete the button from the toolbar.
0 Likes
Message 4 of 4

Anonymous
Not applicable
Hi all!
Based on what I have seen, it appears that the PATH to a particular piece of maxscript (such as custom attributes) actually gets stored in the .max file itself. The result is that if I move the script to a different directory, then when I load the .max file, it can't find it.

How do I change the script path that's stored in the .max file itself?

Thanks!
Andrew


hi Andrew!
custom attributes paths are NOT stored in a file, the hole script code is stored in what ever object you applied the attribute too.
so moving what ever source code you used to create the attribute around will not give you script errors.

now if you are doing a "fileIn" or sourcing a script from inside a custom attribute or script controller (let say your calling functions from a custom studio library) then that's a different story. by using a filein you are actually telling the custom attribute to run an external script, so if the file your sourcing in is moved you may have problems like what you stated on your post.
the easiest way to avoid this is to keep your external function library's in the script directory in the max root. you could save them on the startup menu but this will make max boot slower.
if you save all your scripts on in the scripts folder on the max root directory you can then use the get dir to query the directory dynamically.
so instead of sourcing in a script like this

filein "c:\\3dsmax9\\scripts\\mySuperCoolScript.ms"

you can do the follwoing

fileIn (getDir #scripts + "\\mySuperCoolScript.ms")

by doing this your code will always be found even if you have installed max to a non standard directory, or if you have different max versions.
have fun brother.

cheers,
Los.
0 Likes