justinfx / MayaSublime

Send selected Python and MEL code snippets from SublimeText to Maya via commandPort
MIT License
149 stars 38 forks source link

cannot send multi-line statement #14

Closed a0077952 closed 10 years ago

a0077952 commented 10 years ago

If I send the code in this format, maya will report a syntax error. for( $item in $bbox ) { print($item + "\n"); print($item + "\n"); }

But If I send like this, it's fine. for( $item in $bbox ) { print($item + "\n"); print($item + "\n"); }

Any idea on how to solve this issue? Thank you!

justinfx commented 10 years ago

Hi. Could you try the patch I just pushed to the issue14 branch. If you can give it a couple tests under your own code and confirm its good for MEL, i will merge it into master.

For some reason (and I am not exactly sure under what circumstance this became a problem), the command is getting fowled up on the newlines being used to join the string before sending. I switched it to use space separation for MEL, which appears to correct your example.

a0077952 commented 10 years ago

Thanks for a fast reply! It works perfectly now :D

test case polyCylinder -r 0.5 -h 6 -sx 12 -sy 1 -sz 1 -ax 0 1 0 -rcp 0 -cuv 3 -ch 1 -n test1;

float $bbox[] = exactWorldBoundingBox test1; for( $item in $bbox ) {

print($item + "\n"); 
            print($item + "\n"); 

} print("Bounding box ranges from: "

justinfx commented 10 years ago

Merged into master. Thanks for the efforts!