Im new to mel.. so sorry if this seems kinda dumb...
Im trying to write a proc that runs a command based on a prevously stored string array
here is the proc:
global proc project(){
for ($each in $surfaces)
{
projectCurve -ch true -rn false -un false -tol 0.0125 $curve $each;
}
}
maya tells me that all 3 of my variables are undeclared!
how can I store a variable in my script that is available to
all of my procs?
any help or suggestions would be greatly appreciated!
thx
hi,
you have to define gloabl variables if you want procs to share them, try this example
hope it helps
global string $surfaces[];
global string $curve;
global proc project()
{
global string $surfaces[];
global string $curve;
$surfaces = ls -sl;
$curve = "nurbsCircle1";
for ($each in $surfaces)
{
projectCurve -ch true -rn false -un false -tol 0.0125 $curve $each;
}
printcmds;
}
global proc printcmds()
{
global string $surfaces[];
global string $curve;
print $surfaces;
print $curve;
}
project;
regards
pramod