Syntax Error MEL listRelatives

Syntax Error MEL listRelatives

Anonymous
Not applicable
639 Views
1 Reply
Message 1 of 2

Syntax Error MEL listRelatives

Anonymous
Not applicable

I've got a MEL script that I'm trying to get to work, but it keeps dying on this line of code. I've isolated this line of code and it throws a syntax error:

 

string $objList[] = 'listRelatives -s -path "nexus"';

 

Below is the full code that I'm using. I'm trying to get the listRelatives function to work. I'm using it in another 1000+ lines of code and it throws an error, that's why I've isolated it in this manner. I'm using the example listed here to validate the function works:

 

http://help.autodesk.com/cloudhelp/2015/ENU/Maya-Tech-Docs/Commands/listRelatives.html

 

Win7/Maya2012

 

//

 

sphere -n "nexus";

instance -n "ball";

 

string $objList[] = 'listRelatives -s -path "nexus"';

 

listRelatives -allParents $objList[0];

 

 

 

 

0 Likes
640 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable

Hi,

 

you are using the wrong characters. You are using ' but you must use `!

string $objList[] = `listRelatives -s -path "nexus"`;