Posted By

volvis on 06/17/09


Tagged

project folder automatically maxscript projectfolder


Versions (?)

Change Project Folder automatically if present


 / Published in: Maxscript
 

URL: http://karkijoukkue.fi

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.

  1. callbacks.addScript #filePostOpen "phTraverseProjectPath()" id:("phTraverseProjectPath" as name)
  2.  
  3. fn phTraverseProjectPath = (
  4.  
  5. curPath = maxFilePath
  6. queryAnswer = false
  7.  
  8. for i = 1 to 15 do (
  9. if curPath == "" do continue;
  10. if pathConfig.isProjectFolder curPath then (
  11. if (pathConfig.getCurrentProjectFolder() != curPath) do (
  12. if (queryAnswer == false) do (
  13. if (queryBox ("Change Project Folder?\n" + (curPath as String))) do (
  14. pathConfig.setCurrentProjectFolder curPath
  15. )
  16. queryAnswer = true
  17. )
  18. )
  19. )
  20. curPath = pathConfig.removePathLeaf curPath
  21. )
  22.  
  23. )

Report this snippet  

You need to login to post a comment.