PDA

View Full Version : organizing scripts


modi
11-14-2003, 05:48 AM
I have so many scripts in my scripts folder that i need to organize them in subfolders. But how do i tell maya to source the scripts in the subfolders on startup. thanks.

bentllama
11-14-2003, 08:16 AM
I do this alot. I have all my scripts in separate directories and directories based on project...

You can add an environment variable to your machine point Maya to the right folders:

- go to System Properties
- click Advanced tab
- click Environment Variables
- click NEW
- enter MAYA_SCRIPT_PATH for the variable name
- for variable value enter what directory you want Maya to look for MEL scripts ...for example C:\halo2\data\MELscripts would search for scripts in that directory

you can add multiple directories for the one MAYA_SCRIPT_PATH environment variable... just make sure you separate them with a semi-colon [;] and no spaces...

so my variables for all kinds of different scripts looks like this:

C:\halo2\data\MELscripts;C:\THOR\maya\scripts\temp;C:\THOR\maya\scripts\halo2;C:\THOR\maya\scripts\anim;C:\THOR\maya\scripts\light;C:\THOR\maya\scripts\scratch;C:\THOR\maya\scripts\render;C:\THOR\maya\scripts\nurbs;C:\THOR\maya\scripts\poly;C:\THOR\maya\scripts\rig;C:\THOR\maya\scripts\subD;C:\THOR\maya\scripts\texture;C:\THOR\maya\scripts\tools;C:\THOR\maya\scripts\ui;C:\THOR\maya\scripts\data;C:\THOR\maya\scripts\clipFX;C:\THOR\maya\scripts\paintFX;C:\THOR\maya\scripts\dnamics;C:\THOR\maya\scripts\cloth;C:\THOR\maya\scripts\fur;C:\THOR\maya\scripts\hair

hmm...I should put this information on my website. this is not the first time people have asked. most have no idea you can do this...

modi
11-14-2003, 08:24 AM
wow, thank you.

safakoner
11-14-2003, 08:57 AM
or

create a "maya.env" file with notepad in maya/5.0 folder.
and write address in this file like this:

MAYA_SCRIPT_PATH = %MAYA_APP_DIR%\equinox
MAYA_SCRIPT_PATH = %MAYA_APP_DIR%\modeling
MAYA_SCRIPT_PATH = %MAYA_APP_DIR%\rendering
etc.

restart Maya

this is very funny :bounce:

bentllama
11-14-2003, 04:49 PM
Originally posted by equinox
or

create a "maya.env" file with notepad in maya/5.0 folder.
and write address in this file like this:

MAYA_SCRIPT_PATH = %MAYA_APP_DIR%\equinox
MAYA_SCRIPT_PATH = %MAYA_APP_DIR%\modeling
MAYA_SCRIPT_PATH = %MAYA_APP_DIR%\rendering
etc.

restart Maya



good point.

the only thing that prevents is using those env variables with other versions of maya. you will always have to copy that text file into directories of past or current versions of the application

modi
11-14-2003, 08:52 PM
thanx for the replies,
bentalma, i got your method to work but equinox i can't get the your method to work.
maya.env is in my 5.0 folder
and heres what i typed in
MAYA_SCRIPT_PATH = C:\Documents and Settings\PRAMOD1\My Documents\maya\5.0\scripts\rigg
MAYA_SCRIPT_PATH = C:\Documents and Settings\PRAMOD1\My Documents\maya\5.0\scripts\anim
etc
restarted maya but it won't work. Am i missing something or some syntax error?? thanx.

bentllama
11-14-2003, 09:07 PM
Originally posted by modi
thanx for the replies,
bentalma, i got your method to work but equinox i can't get the your method to work.
maya.env is in my 5.0 folder
and heres what i typed in
MAYA_SCRIPT_PATH = C:\Documents and Settings\PRAMOD1\My Documents\maya\5.0\scripts\rigg
MAYA_SCRIPT_PATH = C:\Documents and Settings\PRAMOD1\My Documents\maya\5.0\scripts\anim
etc
restarted maya but it won't work. Am i missing something or some syntax error?? thanx.

probably the spaces in your "My Documents" folder path...

I always rename that folder...

SPACES_ARE_EVIL

safakoner
11-15-2003, 07:35 AM
I completely agree

Don3Don
11-15-2003, 03:32 PM
My method is using varibles to replace the long same path of every script folder.... may be a stupid method.
And "My Docments" with space folder name is works for me.

I guess you could not assign "MAYA_SCRIPT_PATH" more than one times..It will only assign the path of your last assignment. I only use one assginment.. (If I'm correct.)

By the way, "XBMLANGPATH" is to assign your icons path.:)

//=================================================
mpS_=%USERPROFILE%\My Documents\maya\5.0\scripts
mpP_=%USERPROFILE%\My Documents\maya\5.0\plugins
mpI_=%USERPROFILE%\My Documents\maya\5.0\prefs\icons

MAYA_SCRIPT_PATH = $mpS_\model;$mpS_\model\cps;$mpS_\light;$mpS_\dynamic;$mpS_\shader;$mpS_\animation;$mpS_\!3don;$mpS_\centro;$mpS_\bonusGame50;$mpS_\light\lightGirl;$mpS_\animation\poseStudio;$mpS_\misc\xyScript;$mpS_\misc;$mpS_\misc\ptb;

MAYA_PLUG_IN_PATH = $mpP_;

XBMLANGPATH = $mpI_\3don_icons;$mpI_\cps;$mpI_\ptb;
//=================================================

brubin
11-16-2003, 10:51 PM
just as an additional pointer - and i'm not exactly sure whether the maya.env file behaves like any ordinary mel-script (hence the different file ext.), but:

to deal with those f*%&$ed up windows path-names (yes, SPACES_ARE_EVIL and foldernames with 20+chars. are HELL!) in MEL you use "\", so for maya not to catenate your path to something like "c:ocuments" quote the "\" with an additional "\", and to be sure, do the same thing for any "whiteSpace", so maybe try something like this:

C:\\Documents\ and\ Settings\\PRAMOD1\\My\ Documents\\maya\\5.0\\scripts\\rigg

if it doesn't help in maya.env, it sure will in MEL.

HIH
s.

safakoner
11-29-2003, 01:06 PM
Originally posted by modi
thanx for the replies,
bentalma, i got your method to work but equinox i can't get the your method to work.
maya.env is in my 5.0 folder
and heres what i typed in
MAYA_SCRIPT_PATH = C:\Documents and Settings\PRAMOD1\My Documents\maya\5.0\scripts\rigg
MAYA_SCRIPT_PATH = C:\Documents and Settings\PRAMOD1\My Documents\maya\5.0\scripts\anim
etc
restarted maya but it won't work. Am i missing something or some syntax error?? thanx.

oh sorry

%MAYA_APP_DIR% = this command definition maya's address automaticly. ( My Documents\maya\ )
You must create a custom folder under this address if you want to use this.

Example.
1) You create a folder called "rendering" under "My Documents\maya\"

2) Create a maya.env file under "My Documents\maya\5.0" folder.

3) Write this address in your maya.env file.
MAYA_SCRIPT_PATH = %MAYA_APP_DIR%\rendering
restart maya.
:bounce:

CGTalk Moderation
01-16-2006, 04:00 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.