Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® Maya® / MEL / Invalid Syntax?
  RSS 2.0 ATOM  

Invalid Syntax?
Rate this thread
 
56344
 
Permlink of this thread  
avatar
  • J.D.
  • Posted: 28 May 2011 05:59 AM
  • Location: Berlin
  • Total Posts: 65
  • Joined: 17 November 2010 04:53 AM

Hey every1,

Im trying to simply replace the “_l_” with “_r_” in the mirrored IK controls.
but somehow it throws this error in my face when im trying to source the script:

# Error: SyntaxError: invalid syntax #

not quite sure what im missing here :?

thanks for any help :)

//Setup Variables
 
string $objName[]{"thigh01""knee01""ankle01""ball01""toes01""heel01"}//stores Loc & Bone names
 
string $objFam[]{"REAL_","FK_""IK_"};
 
string $objType[]{"bn_","CC_"}//stores the type tag. In this case it's cc for controlCurve
 
string $objPos[]={"l_""r_"};
 
string $ccName[]{"thigh01""knee01""ankle01""ball01""foot01"}//  stores controlCurve Names 


//Mirror IK_ctrls 
 
print ("Mirroring " $objFam[2] +"ctrls...");
 
 
select -($objFam[2] $objType[1] $objPos[0] $ccName[1]);
 
duplicate -($objFam[2] $objType[1] $objPos[1] $ccName[1]);
 
move -rax;
 
searchReplaceNames "_l_" "_r_" "selected";
 
select -cl;
 
 
select -($objFam[2] $objType[1] $objPos[0] +  $ccName[4]);
 
duplicate -($objFam[2] $objType[1] $objPos[1] $ccName[4]);
 
move -rax;
 
searchReplaceNames "_l_" "_r_" "selected";
 
select -cl;
 
 print 
"done.\n";


AutoWalk script out on CreativeCrash!
http://www.creativecrash.com/may...gins/animation/c/autowalk
Jeeves Simple Biped Rig:
http://www.creativecrash.com/maya/downloads/character-rigs/c/jeeves
Dload, test & share! Feedback very much appreciated!

Replies: 1
/userdata/avatar/avatar_281222.jpg

Best tool to start with is to turn the error line numbers on in the script editor. It will tell you the line and character position that it is choking on. Very useful.

Author: Wesley Howe

Replied: 29 May 2011 06:45 AM