PDA

View Full Version : Syntax Error


n8vfx
02-12-2007, 04:23 PM
Sorry to bother you guys with this, but I am stumped. I just started reading a book about mel and I can not figure this part out. I did every thing the book asked me to do and it makes since to me, not sure why I am getting this error. I will post the scrpit and maybe someone could take a look at it and tell me what I am doing wrong. Let me know if you can't source the script in maya and I will tell you where I am getting the errors. Thanks for any help at all.

-nathan

n8vfx
02-12-2007, 06:33 PM
maybe this information will help. Here is the code in quesion...

// Change height and bend values to accommodate user input.
switch ( $style )
{
case "short":
{
$grassHeight = `rand 0.4 0.8`;
$grassCurl = `rand 0 (-.1)`;
$envelopeVal = `rand 0.9 1.0`;
switch ( $detail )
case "low" :
$grassDetail = 1;
break;
case "medium" :
$grassDetail = 3;
break;
case "high" :
$grassDetail = 5;
break;
}
break;

everything worked well before I added the second switch statment for the detail. it gives me an error on the lines with the words... case "low" : as well the ones for medium and high. Any help would rock.

-nathan

animationrigs
02-12-2007, 08:40 PM
looks like you are missing your opening brace
switch ($var)
{
case "whatever":
doStuff();
break;
}

n8vfx
02-12-2007, 08:49 PM
Thank you very much. That was it. The guy that wrote this book I am using (The MEL Companion, Maya Scrpiting for 3D Artists) is either very smart (puting in bad scpits and leaving somethings out, forcing you to find the problems and thus learning more about MEL) or did not check his scrpits very well. Either way thanks agian.

-nathan

CGTalk Moderation
02-12-2007, 08:49 PM
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.