PDA

View Full Version : Script Folder Setup


tdruckenmiller
10-04-2010, 12:09 PM
I have scripted my own GUI and have been running it from my project folders for over a year now. Each time I start a new project I copy the script files over to that new project, but then when I edit the script I end up having multiple versions of the script all over my computer. I am not too sure about where to put my script for a one time use. I created a folder in my C:/Program Files/Autodesk/Maya/scripts/ and inside of that folder I have all of the scripts to run my GUI. The only problem is that now my main file does not source the other files. Currently I have the header setup as follows:

source Rivet.mel;
source CurlNoise.mel;

and so on. What do I need to change within this script so that these files will be sourced correctly?

djx
10-04-2010, 01:01 PM
Maya has several default locations where it will look to find scripts that you call by name. However it can be easier to manage if you tell it where you want it to look. There is a special file called Maya.env that you should search for. If you've never used it, then it will be empty, but it is a simple text file where you can specify environment variables. The one you want is MAYA_SCRIPT_PATH. For example you could put the following line in Maya.env

MAYA_SCRIPT_PATH = x:\tdruckenmiller\maya\2011-x64\scripts;

This will add the path you specify to the list of places that maya looks for your scripts.
I've written more details here (http://www.djx.com.au/blog/customizing-maya/) (its a bit old now, but could still be useful to read).

David

tdruckenmiller
10-04-2010, 01:38 PM
I followed your instructions, and I created the file Maya.env. I placed the appropriate information within it, and saved it. Still when I try to source a script it gives me the same error. I am not sure if this is a problem because I am running Windows 7, and something might be different.

Edit: I figure out my problem. I found the Maya.env that needed to be edited. I had saved mine in a different location. Thanks for the help. It works great.

CGTalk Moderation
10-04-2010, 01:38 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.