/ Published in: Maxscript
When placed in startup scripts, this snippet activates every time user opens a file. It then traverses the directory path backwards and looks for user created project folders. If one is found, script offers to switch it on.
This is very useful when working with a number of projects at a time.
This is very useful when working with a number of projects at a time.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
callbacks.addScript #filePostOpen "phTraverseProjectPath()" id:("phTraverseProjectPath" as name) fn phTraverseProjectPath = ( curPath = maxFilePath queryAnswer = false for i = 1 to 15 do ( if curPath == "" do continue; if pathConfig.isProjectFolder curPath then ( if (pathConfig.getCurrentProjectFolder() != curPath) do ( if (queryAnswer == false) do ( if (queryBox ("Change Project Folder?\n" + (curPath as String))) do ( pathConfig.setCurrentProjectFolder curPath ) queryAnswer = true ) ) ) curPath = pathConfig.removePathLeaf curPath ) )