Maya Batch - truncated command return Syntax Error

Maya Batch - truncated command return Syntax Error

bdewalleDD7LQ
Contributor Contributor
837 Views
2 Replies
Message 1 of 3

Maya Batch - truncated command return Syntax Error

bdewalleDD7LQ
Contributor
Contributor

Hi,

I'm trying to create a mayabatch job with the command line.

 

Mayabatch returns a Syntax Error on any -command I try to apply on the scene, showing a truncated command:

 

 

"C:/Program Files/Autodesk/Maya2020/bin/mayabatch.exe" -file test.ma -command "playblast  -format qt -filename "test.mov" -fo -sequenceTime 0 -clearCache 1 -viewer 1 -showOrnaments 0 -fp 4 -percent 100 -compression "JPEG 2000" -quality 100 -widthHeight 1920 1080;"

 

will return an error:

Result: test.ma
Error: playblast -format qt -filename playblast -format qt -filename "test.mov" -fo -seque;

Error: Line 1.34: Syntax error

 

Another exemple:

"C:/Program Files/Autodesk/Maya2020/bin/mayabatch.exe" -file test.ma -command "python("print('pouic '*50)");"

returns:

 

Result: test.ma
Error: python(print('pouic;
Error: Line 1.14: Syntax error

 

Any idea how to make this work?

 

Thanks

Accepted solutions (1)
838 Views
2 Replies
Replies (2)
Message 2 of 3

brentmc
Autodesk
Autodesk
Accepted solution

Hi,

 

You need to escape the double quotes inside the command string.

For Windows command shell you just double up the internal quotes as described in this stack overflow answer:
https://stackoverflow.com/questions/562038/escaping-double-quotes-in-batch-script

Notice how I added extra quotes around ""test.mov"" and ""JPEG 2000"".

 

"C:/Program Files/Autodesk/Maya2020/bin/mayabatch.exe" -file test.ma -command "playblast  -format qt -filename ""test.mov"" -fo -sequenceTime 0 -clearCache 1 -viewer 1 -showOrnaments 0 -fp 4 -percent 100 -compression ""JPEG 2000"" -quality 100 -widthHeight 1920 1080;"

 

 

--

Brent

Brent McPherson
Principle Engineer
0 Likes
Message 3 of 3

bdewalleDD7LQ
Contributor
Contributor

Awesome, it works!

Thanks  🙂

0 Likes