Mel Script for automatically generating control curves

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
  12 December 2010
Mel Script for automatically generating control curves

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.
 
  12 December 2010
hi,

i think you're missing a semi-colon here
makeIdentity -apply 1 -t 1 -r 1 -s 1  
__________________
vimeo
blog
 
  12 December 2010
And that worked perfectly. You have no idea how long I kicked myself over that one. Much appreciated.
 
  12 December 2010
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 02:36 AM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.