sqrlcub
12-27-2010, 09:29 AM
I'm working through the digital tutors Maya 2010 rigging tutorials; however, it seems that there are some weirdness within their Mel Scripting.
I'm receiving the following errors:
// Error: string $relCrv2[] = `listRelatives -shapes $cv2[0]`; //
// Error: Syntax error //
// Error: parent -r -shape $relCrv2[0] $cv1[0];
//
// Error: "$relCrv2" is an undeclared variable. //
I've printed the script below. I don't believe that I have any typos and am pretty much just following the tutorial verbatim. However, I'm not sure what the problem is. I know when I delete this problematic line and have a virtually identical one afterwards, I no longer receive the undeclared variable error but instead simply receive the syntax error message.
Any help is greatly appreciated.
//joint curve
//create curves
string $cv1[]= `circle -c 0 0 0 -nr 0 1 0 -sw 360 -r 1 -d 3 -ut 0 -tol 0.000328084 -s 8 -ch 1`;
string $cv2[]= `circle -c 0 0 0 -nr 0 1 0 -sw 360 -r 1 -d 3 -ut 0 -tol 0.000328084 -s 8 -ch 1`;
string $cv3[]= `circle -c 0 0 0 -nr 0 1 0 -sw 360 -r 1 -d 3 -ut 0 -tol 0.000328084 -s 8 -ch 1`;
//rotates our curves to look like a joint
rotate -r -os 90 0 0 $cv2[0];
rotate -r -os 0 0 90 $cv3[0];
//freeze the rotated curves
select $cv2[0]; select -add $cv3[0];
makeIdentity -apply 1 -t 1 -r 1 -s 1
//Parent shapes of curves 2 and 3 to 1
string $relCrv2[] = `listRelatives -shapes $cv2[0]`;
string $relCrv3[] = `listRelatives -shapes $cv3[0]`;
parent -r -shape $relCrv2[0] $cv1[0];
parent -r -shape $relCrv3[0] $cv1[0];
//delete the transform nodes of curves 2 and 3
select $cv2[0]; select -add $cv3[0]; doDelete;
//rename the joint curve
string $rnmCurve = `rename $cv1[0] "jntCrv"`;
//delete the history of the joint curve
select $rnmCurve; deleteHistory;
thanks again.
I'm receiving the following errors:
// Error: string $relCrv2[] = `listRelatives -shapes $cv2[0]`; //
// Error: Syntax error //
// Error: parent -r -shape $relCrv2[0] $cv1[0];
//
// Error: "$relCrv2" is an undeclared variable. //
I've printed the script below. I don't believe that I have any typos and am pretty much just following the tutorial verbatim. However, I'm not sure what the problem is. I know when I delete this problematic line and have a virtually identical one afterwards, I no longer receive the undeclared variable error but instead simply receive the syntax error message.
Any help is greatly appreciated.
//joint curve
//create curves
string $cv1[]= `circle -c 0 0 0 -nr 0 1 0 -sw 360 -r 1 -d 3 -ut 0 -tol 0.000328084 -s 8 -ch 1`;
string $cv2[]= `circle -c 0 0 0 -nr 0 1 0 -sw 360 -r 1 -d 3 -ut 0 -tol 0.000328084 -s 8 -ch 1`;
string $cv3[]= `circle -c 0 0 0 -nr 0 1 0 -sw 360 -r 1 -d 3 -ut 0 -tol 0.000328084 -s 8 -ch 1`;
//rotates our curves to look like a joint
rotate -r -os 90 0 0 $cv2[0];
rotate -r -os 0 0 90 $cv3[0];
//freeze the rotated curves
select $cv2[0]; select -add $cv3[0];
makeIdentity -apply 1 -t 1 -r 1 -s 1
//Parent shapes of curves 2 and 3 to 1
string $relCrv2[] = `listRelatives -shapes $cv2[0]`;
string $relCrv3[] = `listRelatives -shapes $cv3[0]`;
parent -r -shape $relCrv2[0] $cv1[0];
parent -r -shape $relCrv3[0] $cv1[0];
//delete the transform nodes of curves 2 and 3
select $cv2[0]; select -add $cv3[0]; doDelete;
//rename the joint curve
string $rnmCurve = `rename $cv1[0] "jntCrv"`;
//delete the history of the joint curve
select $rnmCurve; deleteHistory;
thanks again.
