ctb
10-10-2006, 11:12 AM
Hi,
I have many MEL scripts that all refer to this variable:
string $dir = "W:/3D/test/"; //directory path
I want to place this path in a separate file (eg. "path.mel") so that if it changes (eg. all MEL files been moved to different location), I don't have to change every individual MEL file.
How do I reference this "path.mel" from all the individual scripts?
Thanks here.
cheers.
The following are my script files:
global proc simpleWindow()
{
string $dir = "W:/3D/test/"; //directory path
string $print_A = "source \"" + $dir + "PRINT_A.mel\";PRINT_A";
string $print_B = "source \"" + $dir + "PRINT_B.mel\";PRINT_B";
string $print_C = "source \"" + $dir + "PRINT_C.mel\";PRINT_C";
string $print_D = "source \"" + $dir + "PRINT_D.mel\";PRINT_D";
window -width 150;
columnLayout -adjustableColumn true;
button -label "button A" -command $print_A;
button -label "button B" -command $print_B;
button -label "button C" -command $print_C;
button -label "button D" -command $print_D;
showWindow;
}
--------------------------------------------------------------
global proc PRINT_A()
{
string $dir = "W:/3D/test/"; //directory path
string $A = ("MEL file for button A can be found in " + $dir);
print ($A+"\n");
}
--------------------------------------------------------------
global proc PRINT_B()
{
string $dir = "W:/3D/test/"; //directory path
string $B = ("MEL file for button B can be found in " + $dir);
print ($B+"\n");
}
-------------------------------------------------------------
global proc PRINT_C()
{
string $dir = "W:/3D/test/"; //directory path
string $C = ("MEL file for button C can be found in " + $dir);
print ($C+"\n");
}
----------------------------------------------------------------
global proc PRINT_D()
{
string $dir = "W:/3D/test/"; //directory path
string $D = ("MEL file for button D can be found in" + $dir);
print ($D+"\n");
}
-----------------------------------------------------------
I have many MEL scripts that all refer to this variable:
string $dir = "W:/3D/test/"; //directory path
I want to place this path in a separate file (eg. "path.mel") so that if it changes (eg. all MEL files been moved to different location), I don't have to change every individual MEL file.
How do I reference this "path.mel" from all the individual scripts?
Thanks here.
cheers.
The following are my script files:
global proc simpleWindow()
{
string $dir = "W:/3D/test/"; //directory path
string $print_A = "source \"" + $dir + "PRINT_A.mel\";PRINT_A";
string $print_B = "source \"" + $dir + "PRINT_B.mel\";PRINT_B";
string $print_C = "source \"" + $dir + "PRINT_C.mel\";PRINT_C";
string $print_D = "source \"" + $dir + "PRINT_D.mel\";PRINT_D";
window -width 150;
columnLayout -adjustableColumn true;
button -label "button A" -command $print_A;
button -label "button B" -command $print_B;
button -label "button C" -command $print_C;
button -label "button D" -command $print_D;
showWindow;
}
--------------------------------------------------------------
global proc PRINT_A()
{
string $dir = "W:/3D/test/"; //directory path
string $A = ("MEL file for button A can be found in " + $dir);
print ($A+"\n");
}
--------------------------------------------------------------
global proc PRINT_B()
{
string $dir = "W:/3D/test/"; //directory path
string $B = ("MEL file for button B can be found in " + $dir);
print ($B+"\n");
}
-------------------------------------------------------------
global proc PRINT_C()
{
string $dir = "W:/3D/test/"; //directory path
string $C = ("MEL file for button C can be found in " + $dir);
print ($C+"\n");
}
----------------------------------------------------------------
global proc PRINT_D()
{
string $dir = "W:/3D/test/"; //directory path
string $D = ("MEL file for button D can be found in" + $dir);
print ($D+"\n");
}
-----------------------------------------------------------
