PDA

View Full Version : Sourcing in Mel


JimmyM
05-26-2009, 01:55 PM
I have jsts created a simple script that writes to UltraEdit. I chose the app because unlike maya it has
colour references and the lines on it are more visible than that of maya.


Its goes :

string $currentPath = `internalVar -userScriptDir`;
chdir $currentPath;
string $UltraEdit = ("start D:/Program Files"...Uedit.exe syncFile.mel)
system($UltraEdit);

These simple code creates a file named syncFile in UltraEdit and saves it as
syscFile.mel in the scripts directory located in my Documents if you are using windows.


I made a button out of these.

From the Script editor, I then typed:


source syncFile.mel;

in hopes that it will see the file but it does not unless I spoon feed it the path eg. source "D:/Program File...");

Do you guys know what I am doing wrong?

CoHPhasor
05-27-2009, 06:51 AM
I assume you used "rehash" when you first added that script, right?
(ie, when you made syncFile.mel and placed it in the default script dir you typed teh rehash command in Maya)

rehash asks Maya to rebuild it's table, then source tells Maya to erase the old version
and replace it with the new.

JimmyM
05-28-2009, 07:38 AM
It works like a bomb! thanx man. It goes to show little mistakes cn cause a day filled with havoc!!!

CoHPhasor
05-29-2009, 12:03 AM
It happens. Glad to help!

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