I’ve been searching online all day for a command that will tell me what the user script directory is in maya
I have tried
InternalVar -usd
but it returns the version specific script directory IE.
C:/Users/<Username>/Documents/maya/2012-x64/scripts/ in windows
what I am looking for is this directory
C:/Users/<Username>/Documents/maya/scripts/
Take the directory from InternalVar, go to steps up and then descend into ./scripts or make it if it doesn’t exist. If there’s a maya/2012 directory then there sure is (or should be) a maya/scripts directory. Or is there any reason this won’t work for you?
You should also check MAYA_APP_DIR and see if someone re-routed these folders. But the structure of the whole maya folder is usually the same. In the worst case (which I doubt will happen, never happened for us and we have some clients re-routing the maya user folders) just prompt the user.
If you’re trying to look for a location to deploy scripts to, I don’t recommend using the user’s scripts directory. This becomes a trash heap for all kinds of unsavory things. I would add some other directory to Maya’s search path when you launch Maya instead. Almost everyone ends up inventing a “mayalauncher” at some point to manage this, but you can just play with the user’s environment variables as well. For MEL, you want to set MAYA_SCRIPT_PATH, and for the python side, set PYTHONPATH.