As of 3ds Max 2022.1 Update, the way various file access functions search for a file specified without a fully qualified path is standardized to prevent "script planting". "Script planting" is a technique used to trick applications into loading malicious scripts. MAXScript mitigates this security vulnerability by only loading scripts from a few well-controlled locations.
This table shows where functions that load files or scripts search for files when the full path is not specified.
MAXScript Function | Current MZP | Current script dir | User scripts | System scripts | User startup scripts | System startup scripts |
---|---|---|---|---|---|---|
fileIn | ✓ | ✓ | ✓ | ✓ | ✗ | ✗ |
include | ✓ | ✓ | ✓ | ✓ | ✗ | ✗ |
encryptScript | ✗ | ✗ | ✓ | ✓ | ✗ | ✗ |
edit | ✓ | ✗ | ✓ | ✓ | ✗ | ✗ |
openFile | ✓ | ✓ | ✓ | ✓ | ✗ | ✗ |
createFile | ✓ | ✓ | ✓ | ✓ | ✗ | ✗ |
openEncryptedFile | ✓ | ✓ | ✓ | ✓ | ✗ | ✗ |
openLog | ✓ | ✓ | ✓ | ✓ | ✗ | ✗ |
callbacks.AddScript | ✓ | ✓ | ✓ | ✓ | ✗ | ✗ |
mzp run | ✓ | ✓ | ✓ | ✓ | ✗ | ✗ |
PFlow pf.Final_Step_Update_Script_File pf.Every_Step_Update_Script_File |
✓ | ✓ | ✓ | ✓ | ✗ | ✗ |
python.ExecuteFile | ✗ | ✗ | ✓ | ✓ | ✓ | ✓ |
startup.ms | N.A. | N.A. | ✓ | ✓ | ✓ | ✓ |
#userscripts
, #systemscripts
, #userstartupscripts
and #startupScripts
respectively. See 3ds Max System Directories.