I have created a PostJobScript step for a Maya plugin that converts rendered EXRs from the default Maya format to one that Nuke prefers. I wrote it originally in Python, tested it manually, but when I hooked it up as a PostJobScript I ran into two problems.
- I can not seem to capture any output from my script, to aid in debugging and progress reports. These two statements do not appear in the log. Perhaps I am looking in the wrong log.
def main():
ScriptUtils.LogText( “hello world”)
print ‘hello world’
- I did not realize that IronPython does not support the Python os module. I started to convert the script calls over to Iron Python, for example, instead of using the os module I did something like this:
Before:
# remove the temp dir if it exists, and then create it
if os.path.exists(tmpDir):
shutil.rmtree(tmpDir)
os.mkdir(tmpDir)
After:
# remove the temp dir if it exists, and then create it
if Directory.Exists(tmpDir):
Directory.Delete(tmpDir,True)
Directory.CreateDirectory(tmpDir)
… but I was unable to successfully convert it all, without the help of debug messages. I also explored trying to force the os module into IronPython by appending my sys path, like this:
import sys
sys.path.append(“pathtomypythonlib”)
import os
but I encountered errors with that as well.
I think the first step is figuring out why I cant get feedback into the logs.
Thanks for any suggestions!
Seth