PDA

View Full Version : Script works in Maya, not sent from TextMate/Automator Service...


andrewhake
03-09-2011, 01:09 AM
Just testing sending MEL from TextMate.

What is going on in this script that causes it to send Syntax errors when sent from TextMate?

//Create object array - spheres

int $xDepth = 4;
int $yDepth = 4;
int $zDepth = 4;

for($x = 0; $x < $xDepth; $x++) {
for($y = 0; $y < $yDepth; $y++) {
for($z = 0; $z < $zDepth; $z++) {
polySphere -r 1;
move (2 * $x) (2 * $y) (2* $z);
}
}
}



This is what I am getting back:

// Error: //
// Error: Line 2.0: Syntax error //
// Error: //
// Error: Line 2.0: Syntax error //
// Error: //
// Error: Line 2.0: Syntax error //
// Error: }; //
// Error: Line 1.1: Syntax error //
// Error: }; //
// Error: Line 1.1: Syntax error //
// Error: }; //
// Error: Line 1.1: Syntax error //


Works fine from the Maya script editor... TextMate is definitely sending it to Maya, but there is something Maya doesn't like about it. Please let me know if it is just poorly written, etc.

Thanks

r4inm4ker
03-09-2011, 01:13 AM
is it in unicode format (in your Textmate editor)? MEL only accepts ASCII codes.

cgbeige
03-09-2011, 01:31 AM
works for me sending from BBEdit with my Automator Service (which uses the same Ruby code from TextMate). The code seems fine.

andrewhake
03-09-2011, 02:28 AM
Hmm, getting the same thing no matter where I send it from, here is the full output after sending it from TextMate, or the Automator Service...

//Create object array spheres;
int $xDepth = 4;
// Result: 4 //
int $yDepth = 4;
// Result: 4 //
int $zDepth = 4;
// Result: 4 //
for($x = 0; $x < $xDepth; $x++) {;
// Error: //
// Error: Syntax error //
for($y = 0; $y < $yDepth; $y++) {;
// Error: //
// Error: Syntax error //
for($z = 0; $z < $zDepth; $z++) {;
// Error: //
// Error: Syntax error //
polySphere -r 1;
// Result: pSphere1 polySphere1 //
move (2 * $x) (2 * $y) (2* $z);
};
// Error: }; //
// Error: Syntax error //
};
// Error: }; //
// Error: Syntax error //
};
// Error: }; //
// Error: Syntax error //

Something about that for loop it doesn't like, but it does create the 1 sphere.

This is on clean default prefs.

andrewhake
03-09-2011, 03:04 AM
Same results with brand new User, all clean prefs, Maya 2009, Maya 2011, same results. It seems to be treating each line like it was sent one by one, one line, result, next line. Driving me crazy...

cgbeige
03-10-2011, 04:47 AM
The only thing I can think of is that it's how your line break encoding is set.

CGTalk Moderation
03-10-2011, 04:47 AM
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.