PDA

View Full Version : maya 6 source script gives errors


john_homer
06-22-2004, 09:56 PM
Please read entire post before replying.
OK, I feel a bit stupid even posting this because I cant see how maya 6 can be this bad, so i feel like it must be me... but...

in maya 5 i could create a new script (example newScript.mel), WHILE MAYA IS RUNNING and put it in,
C:\Documents and Settings\homer\My Documents\maya\5.0\scripts
then source it with "source newScript", that would source it, then i could run it with "newScript".
simple stuff, however... in maya 6, i do the same thing, but put it in,
C:\Documents and Settings\homer\My Documents\maya\6.0\scripts (WHILE MAYA IS RUNNING),
and source it "source newScript", i get an error...
Error: Cannot find file "newScript" for source statement.

then if i source it through the script editor menu, it works, and i can run it, but even after that, if i try to source it again it errors.

please note:
1:it is not the script, it does this to all new scripts introduced WHILE MAYA IS RUNNING.
2: this only happend if the script was NOT in the scripts folder when maya starts up
3: I am using the default maya directory, looks like alias have changed where maya is looking thogh... the question really is.. to where?

thanks
.j

wolverine
06-22-2004, 10:06 PM
Maya 6 caches the script directory, so everything new added after caching is ignored when sourced.. type 'rehash' (which re-caches the directory(s)) and source your script.. From there on you can just keep sourcing away.. As soon as you add a new script "file" you gotta 'rehash' again.

Cheers,
G!

john_homer
06-22-2004, 10:34 PM
thanks wolverine,

i wonder if alias had a good reason to do this......
seems odd to me, but wadda i know :shrug:

.j

Sanctuary
06-23-2004, 10:19 AM
thanks wolverine,

i wonder if alias had a good reason to do this......
seems odd to me, but wadda i know :shrug:

.j
they have ... this method speed up the things when you are working with huge number of MEL scripts (e.g. 200 - 300)

CGTalk Moderation
01-18-2006, 02: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.