(MEL) source a script that is not directly under the scripts folder?

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 04 April 2009   #1
(MEL) source a script that is not directly under the scripts folder?

Hi!

Lets say I want to source a script i´m working on, but to keep the scripts-folder less cluttered I have the script in a subfolder.

So the "searchpath" would be for example /scripts/animationScripts/UI

How do I source the scripts that are under that folder? Maya doesn´t seem to go through the subfolders when doing a source?

Otto
 
Old 04 April 2009   #2
you could add :-

MAYA_SCRIPT_PATH
C:/path/destination folder


to your system enviroment variables(control panel > system > advanced > enviroment variables > system variables).



cheers

Craig

Last edited by skunk184 : 04 April 2009 at 05:07 PM.
 
Old 04 April 2009   #3
You can add MAYA_SCRIPT_PATH environment variable in the Maya.env file.

or

I did a little different approach for this (it's a little bit more work for Maya, but I think this gives flexibility). I have a code that reads a particular environment variable (that has my own script directory path) and then source all the files from that folder. I add this code to userSetup.mel file so that all of my script files get sourced when maya starts. I have a setup script that generates this userSetup.mel file for me and also allows me to change my script directory anytime from Maya using a dialogbox. And scripts are resourced from that directory.
__________________
[ myRiggingBLOG ]
[ myAnimBLOG ]
[ myWebsite ]
"Life is animation and we are our own animators." -i
 
Old 04 April 2009   #4
Originally Posted by skunk184: you could add :-

MAYA_SCRIPT_PATH
C:/path/destination folder


to your system enviroment variables(control panel > system > advanced > enviroment variables > system variables).



cheers

Craig


Thanks.

Can I have more than one folder there? When I create a new to old one get overwritten

Otto
 
Old 04 April 2009   #5
yep , just seperate with a semi-colon;

MAYA_SCRIPT_PATH
C:/path/destination folder ;C:/path/destination folder

cheers

Craig
 
Old 04 April 2009   #6
thanks Craig!

Otto
 
Old 04 April 2009   #7
Just so you know - it's actually better to do this in maya.env since you can specify different paths depending on the version of maya you are running. Doing it as an env variable sets this for all versions of maya you have installed.
 
Old 04 April 2009   #8
Thanks Robert and no worries Otto.


Craig
 
Old 04 April 2009   #9
Thread automatically closed

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.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright ©2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 11:01 AM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.