PDA

View Full Version : Sourcing scripts from project's mel folder


ronviers
05-02-2009, 09:35 PM
I am trying to source my scripts from the mel folder that I defined for the project I am working on. The project is called 'anyProject', located here:

C:\Documents and Settings\Ron Viers\Ron's Documents\maya\projects

The script folder is called 'mel', located here:

C:\Documents and Settings\Ron Viers\Ron's Documents\maya\projects\anyProject\mel

In the script editor, I type:

source anyScript;

and get:

// Error: source anyScript; //
// Error: Cannot find file "anyScript" for source statement. //

I read that there is supposed to be a file called 'userSetup.mel' but I have searched all my drives and cannot locate it.
Does anyone know how I can source scripts from my project's mel folder?

Thanks

RyanT
05-03-2009, 02:55 AM
You can do one of two things. You can update your Maya.env file located here:

C:\Documents and Settings\user\My Documents\maya\version\Maya.env

It will be blank. Add this to it:

MAYA_SCRIPT_PATH = D:\look\somewhere;D:\also\look\here;D:\and\also\look\here

You can add a semicolon right after each path to add more.

Or

The userSetup files do not exist automaticly. You can create a userSetup.mel OR userSetup.py file here:

C:\Documents and Settings\user\My Documents\maya\version\scripts\

Every time you start Maya the scripts in that file will auto execute. So you can put something in the userSetup.mel like:
putenv "MAYA_SCRIPT_PATH" "C:\\a\\path\\you\\want";

If you create a .py version you can have it auto execute Python scripts. You can write nearly any script inside of the userSetup files.

RyanT
05-03-2009, 03:09 AM
Sorry you want to edit the USER_SCRIPT_PATH not the MAYA_SCRIPT_PATH environment variable.

ronviers
05-03-2009, 03:57 AM
That worked great.

Thank you.

CGTalk Moderation
05-03-2009, 03:57 AM
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.