YoungFortune
04-22-2011, 12:14 AM
Hello I am following the tutorial "Creature Rigging" Insects..and I am using Maya 2011. My question is has MEL changed or should the scripts written in that particular version of Maya (2009) I believe still work? I wrote the script as instructed:
global proc matchTrns(){
string $mtr[] = `ls -sl`;
if (size($mtr) < 2) {
warning "Must select 2 objects!";
} else if (size($mrt) == 2){
parent;
setAttr ($mrt[0] + ".tx") 0;
setAttr ($mrt[0] + ".ty") 0;
setAttr ($mrt[0] + ".tz") 0;
setAttr ($mrt[0] + ".rx") 0;
setAttr ($mrt[0] + ".ry") 0;
setAttr ($mrt[0] + ".rz") 0;
select $mrt[0];
parent -w;
}
}
And I continue to get this error message:
global proc matchTrns(){
string $mtr[] = `ls -sl`;
if (size($mtr) < 2) {
warning "Must select 2 objects!";
} else if (size($mrt) == 2){
parent;
setAttr ($mrt[0] + ".tx") 0;
setAttr ($mrt[0] + ".ty") 0;
setAttr ($mrt[0] + ".tz") 0;
setAttr ($mrt[0] + ".rx") 0;
setAttr ($mrt[0] + ".ry") 0;
setAttr ($mrt[0] + ".rz") 0;
select $mrt[0];
parent -w;
}
};
// Error: } else if (size($mrt) == 2){
//
// Error: "$mrt" is an undeclared variable. //
// Error: setAttr ($mrt[0] + ".tx") 0;
//
// Error: "$mrt" is an undeclared variable. //
// Error: setAttr ($mrt[0] + ".ty") 0;
//
// Error: "$mrt" is an undeclared variable. //
// Error: setAttr ($mrt[0] + ".tz") 0;
//
// Error: "$mrt" is an undeclared variable. //
// Error: setAttr ($mrt[0] + ".rx") 0;
//
// Error: "$mrt" is an undeclared variable. //
// Error: setAttr ($mrt[0] + ".ry") 0;
//
// Error: "$mrt" is an undeclared variable. //
// Error: setAttr ($mrt[0] + ".rz") 0;
//
// Error: "$mrt" is an undeclared variable. //
// Error: select $mrt[0];
//
// Error: "$mrt" is an undeclared variable. //
Any help on this would be appreciated. I have attempted to space things out move things closer and the error doesn't go away...How do I declare the variable when it isn't supposed to be specified (via the tutorial)?
global proc matchTrns(){
string $mtr[] = `ls -sl`;
if (size($mtr) < 2) {
warning "Must select 2 objects!";
} else if (size($mrt) == 2){
parent;
setAttr ($mrt[0] + ".tx") 0;
setAttr ($mrt[0] + ".ty") 0;
setAttr ($mrt[0] + ".tz") 0;
setAttr ($mrt[0] + ".rx") 0;
setAttr ($mrt[0] + ".ry") 0;
setAttr ($mrt[0] + ".rz") 0;
select $mrt[0];
parent -w;
}
}
And I continue to get this error message:
global proc matchTrns(){
string $mtr[] = `ls -sl`;
if (size($mtr) < 2) {
warning "Must select 2 objects!";
} else if (size($mrt) == 2){
parent;
setAttr ($mrt[0] + ".tx") 0;
setAttr ($mrt[0] + ".ty") 0;
setAttr ($mrt[0] + ".tz") 0;
setAttr ($mrt[0] + ".rx") 0;
setAttr ($mrt[0] + ".ry") 0;
setAttr ($mrt[0] + ".rz") 0;
select $mrt[0];
parent -w;
}
};
// Error: } else if (size($mrt) == 2){
//
// Error: "$mrt" is an undeclared variable. //
// Error: setAttr ($mrt[0] + ".tx") 0;
//
// Error: "$mrt" is an undeclared variable. //
// Error: setAttr ($mrt[0] + ".ty") 0;
//
// Error: "$mrt" is an undeclared variable. //
// Error: setAttr ($mrt[0] + ".tz") 0;
//
// Error: "$mrt" is an undeclared variable. //
// Error: setAttr ($mrt[0] + ".rx") 0;
//
// Error: "$mrt" is an undeclared variable. //
// Error: setAttr ($mrt[0] + ".ry") 0;
//
// Error: "$mrt" is an undeclared variable. //
// Error: setAttr ($mrt[0] + ".rz") 0;
//
// Error: "$mrt" is an undeclared variable. //
// Error: select $mrt[0];
//
// Error: "$mrt" is an undeclared variable. //
Any help on this would be appreciated. I have attempted to space things out move things closer and the error doesn't go away...How do I declare the variable when it isn't supposed to be specified (via the tutorial)?