Hello,
i’m trying to render scenes with non-alphabetical characters in their names through the python subprocess module, but i get a syntax error from the 3dsmaxcmd.exe.
This prints “Syntax Error: (” and a list of all available commands for the 3dsmaxcmd.exe.
Starting the rendering directly from the command line works fine and rendering D:/tmp.max with the python script works also.
Does someone have an idea what i am missing, when i have special characters like “&” or “(” in the scene path?
Can you capture one of the full path strings and post it, please? My first guess is that the special characters are not being escaped correctly, therefore being interpreted incorrectly.
[QUOTE=Jeff Hanna;31224]Can you capture one of the full path strings and post it, please? My first guess is that the special characters are not being escaped correctly, therefore being interpreted incorrectly.[/QUOTE]
What do you mean by “capturing the full path string” ? In my example the full path to the scene is “D:/tmp(.max” .
“D:/test(1)/tmp.max” has the same issue, while “D:/test/tmp.max” is working.
[QUOTE=uiron;31228]from python just don’t add quotes. simple “D:/test(1)/tmp.max” (or, better, “D:\ est(1)\ mp.max”) should work for subprocess.Popen.[/QUOTE]
Not to distract from the thread’s core subject too much, but why is “\” prefered over “/” in this case. I ask because I’m currently standardizing the handling of paths in MAXScript at my studio. At the moment, we’re leaning toward the “/” character method of dividing directories because that approach makes for the shortests path, is Perforce friendly (and is, subjectively, more “elegant” than either the “\” or the “@” character for verbatim strings approaches). All of that said, I’d love to hear what you all have to say on the subject (and now would be a great time for us to change things up). : )
[QUOTE=uiron;31228]from python just don’t add quotes. simple “D:/test(1)/tmp.max” (or, better, “D:\ est(1)\ mp.max”) should work for subprocess.Popen.[/QUOTE]
In this case subprocess.popen has no problem with or without the additional quotes. The syntax error i got is not from the python script, but it is returned from the 3dsmaxcmd.exe and stored in my stdoutdata variable.
For some reason the 3dsmaxcmd.exe can’t handle the argument given by subprocess.popen. So there must be a difference between typing a command directly in the command line and using subprocess.popen.