Ok, I have written some code but can't find where I am making a mistake
global proc oj_addSelToTsl(string $tsl, string $case) {
string $sel[] = ls -sl;
switch($case) {
case "obj":
string $eo;
for($eo in $sel) {
// Request the texScrollList from arguement
textScrollList -e -a $eo $tsl;
}
break;
}
}
The above code works fine but maya gives out a error at the following:
// This variable holds the names of textScrollLists in the UI
string $objTSL[] = {"objTSL","jntTSL","camTSL"};
for($x in $objTSL) {
popupMenu -p $x;
menuItem -l "Add Object" -c "oj_addSelToTsl($x, \"obj\")";
menuItem -l "Add Joint";
menuItem -l "Add Camera";
}
After the above I get an error saying // Error:"$x" is an undeclared variable.