[Closed] 3dsmax 9 Paths
This might be better in the AREA forums, but I wanted to know if this bothered you guys too. I’m posting it specifically here because of how these new Project Paths affect scripters as a whole.
After experiencing how these new paths affected my scripts, I found that other people were having similar problems in the AREA. The 3dsmax.ini file is now tucked away (with lots of other folders) deep into a series of nested folders in My Documents. I realize this is for multiple users and Windows compatibility. Unfortunately I pull information from the 3dsmax.ini file for some scripts, and currently I just hardcoded the path to it as a quick fix. My main question is this: do you guys know of a reliable way to access this deeply nested My Documents location across multiple machines? Is it possible for this .ini file to be in a different location on another computer?
Another question: is there a way to change the default save location of new scripts so that it goes into “C:\Program Files\Autodesk\3ds max 9\ui\scripts” as it ‘should’? I tried setting my Project Path to the 3dsmax 9 root directory but this doens’t seem to solve the problem. Its just a little awkward to be working in this strange directory. I also don’t really know how all these new files are communicating with the 3dsmax 9 root.
Maybe we need a few maxscript methods to directly access these non-root locations?
MAXScript 9 already provides a LARGE number of new methods for dealing with the new paths, Project Folders etc. You just have to read the docs
First, a new #maxData path leads straight to the “special long” path where the 3dsmax.ini is stored. It is the “new root” for user data.
doesFileExist (getDir #maxData + “3dsmax.ini”) –> true
Second, note that the Customize menu has “Configure User Paths” and “Configure System Paths” dialogs. You will notice that the Project Path set in User Paths does not contain a Scripts folder because scripts are considered System data and are not project-specific. So changing the Project Folder to the Max Root in Program Files will not fix the custom location of script files. BUT going to “Configure System Paths” reveals that there are a bunch of new “ADDITIONAL” System Paths to ensure compatibility with future Windows versions that allow Max to have an alternative location for Icons, Macros, Scripts, Startup Scripts, MaxData (see beginning of this post) and Temp files.
So changing “Additional Scripts” to point to a folder of your liking should fix the “problem” (at least in the current version of Windows).
Check out the “3ds Max System Directories” and “Symbolic Pathnames” topics for new GetDir arguments and symbolic pathnames.
Check out “PathConfig Struct” for a HUUUGE number of methods to deal with paths, including absolute/relative paths, Project Folder setups etc.
Also remember that path configurations can be saved to preset files, so switching between configurations should be easy once you get the main idea.
See also the “MAXScript Language Improvements” for some additional info:
[color=white]New User Directories For “Least Privileged” Access[/color]
[left] The new userMacroScripts system pathbecomes a second macroscript load location. Duplicate scripts found in this location take precedence over those found in exe\macroscript. Additional details:
[/left]
[ul]
[li] [left]Macroscript files auto-generated from MAXScript files are placed in this folder. [/li]
[/left]
[li] [left]Macroscript files auto-generated from dragging script text to a toolbar will be placed in this folder. [/li]
[/left]
[li] [left]If a user right-clicks to Edit the Macroscript, and the macroscript was in the default macroscript directory, the script editor filename will be changed to point the file to the userMacroscripts directory. A dialog will be displayed warning that the script editor filename path was changed. If the userMacroscripts and max system macroscript directory are the same, no dialog will be displayed.[/li]
[/left]
[/ul]
[left]The user Macros directory can be set to the max macros directory to retain existing behavior.
[/left]
[left] The new userStartupScriptsis a user location for placing scripts that are run at startup.
[/left]
[left] The new temp system directory provides a safe location to write a temporary file. No special cleanup is done for this directory, this variable is only provided to avoid ambiguity with regards to where a client should write a temp file. Previously, plugins could write to anywhere, including the max root, C: emp, or a location specified by the TMP environment variable. Most of these locations (except perhaps the last) would be invalid under Vista. The temp directory will be directed to a safe-write location.
[/left]
[color=white]Folder Search Order[/color]
[left]Startup Scripts
[/left]
[left]Startup scripts in the 3ds Max system startup scripts directory are run first, and then the Startup scripts in the user startup scripts directory are run, providing that the user startup scripts directory is different than the max system startup scripts directory. The startup.ms file is searched for in the following order:
[/left]
[ul]
[li] [left]The user scripts directory[/li]
[/left]
[li] [left]The user startup scripts directory[/li]
[/left]
[li] [left]The max system scripts directory[/li]
[/left]
[li] [left]The max system startup scripts directory[/li]
[/left]
[li] [left]The 3DS executable main directory[/li]
[/left]
[li] [left]The Windows NT 32-bit system directory (system32)[/li]
[/left]
[li] [left]The Windows 16-bit system directory (system)[/li]
[/left]
[li] [left]The Windows directory[/li]
[/left]
[li] [left]The directories that are listed in the PATH environment variable[/li]
[/left]
[/ul]
[left]The filename specified as an argument to openFile(), encryptScript(), include() and editScript()will now also be searched for in the user scripts directory.
[/left]
In short, if your USER scripts folders are different than the installation scripts folders, the user files take precedence. If you point your User Paths to the Max install, everything should be as in 8 and earlier…
Ahh I see them now. Thanks a bunch Bobo, everything I wanted to know and then some. I should have dug a little further into the help file before going into panic mode.