Thanks for the responses guys. 

Yeah, the reason I put the "try" block with a wide open exception was to detect 
*any* issues... that keep the script from opening and prove that the script is 
indeed failing to open...

@Jose,  agreed that it's best practice to avoid wide open exceptions :)

@Michael, without the "try" block, I just get warnings and then kicked back to 
the sh.

So , if you do something like this:

### openTest.py

import nuke
import os


def main():
   nk = os.path.abspath(sys.argv[1])
   nuke.scriptOpen(nk)
   ### you'll never get past this point with buggy scripts...   
   print nuke.allNodes()

if __name__ == '__main__':
   main()

### end

nuke -t openTest.py myNukeScript.nk

Just shows errors and goes back to the prompt... BUT:

nuke -t
nuke.scriptOpen("myNukeScript.nk")
### doing this interactively in a shell works and allows me to operate -- even 
on scripts with errors...
print nuke.allNodes()

WORKS.

The main point is that the pythonic approach should do the exact same thing as 
the interactive approach I've shown above -- how can I get this?

Cheers,
Jep



_______________________________________________
Nuke-python mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python

Reply via email to