CGTalk > Software Specific Forums > Autodesk Maya > Maya Programming
To minimize the ads you see on this page create a CGTalk account and log in HERE
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 12-27-2010, 10:29 AM   #1
sqrlcub
Veteran
portfolio
Ellis Williams
Beaverton, USA
 
Join Date: Jan 2010
Posts: 91
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.
 
Old 12-27-2010, 12:42 PM   #2
mlefevre
Know-it-All
 
mlefevre's Avatar
matt
technical artist
sony
United Kingdom
 
Join Date: Nov 2007
Posts: 411
hi,

i think you're missing a semi-colon here
Code:
makeIdentity -apply 1 -t 1 -r 1 -s 1
__________________

 
Old 12-28-2010, 10:06 AM   #3
sqrlcub
Veteran
portfolio
Ellis Williams
Beaverton, USA
 
Join Date: Jan 2010
Posts: 91
And that worked perfectly. You have no idea how long I kicked myself over that one. Much appreciated.
 
Old 12-28-2010, 10:06 AM   #4
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,481
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 05:52 AM.


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