PDA

View Full Version : Sourcing Script Problem


ajk48n
05-21-2005, 08:00 PM
I seem to be having a problem sourcing scripts. I'm trying to get a script to get sourced when I load Maya. I've put the file in Documents and Settings/name/My Documents/maya/5.0/scripts

but when i load Maya, I can't call any procedures from the script.

I then tried to source the script through the Script Editor. I 've tried running "source script", as well as going to File, Source Script, but when I run the command nothing happens.

If I try to source a script that doesn't exist, I get errors saying the file cannot be found, but when run on a script that exists, nothing happens. I've turned Echo All Commands on, but still nothing happens.

Does anyone have any ideas?

Thanks in advance

DezFX
05-21-2005, 08:33 PM
If you've saved the script while Maya is open you have to close Maya and relaunch or type "rehash" in the command line or script editor. The file has to be in the folder when Maya is initially launched. Then when you source a script, the proceedure you are trying to execute has to be global. If you have a file called myScript.mel, the entrance to the script has to be a global proceedure called myScript. Then when you source the script you just need to type myScript in the command line or script editor and the script should execute and run.

ajk48n
05-21-2005, 08:47 PM
Thanks man. I restarted Maya, but I didn't know about the global procedure part.

CGTalk Moderation
05-21-2005, 08:47 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.