reading nuke script from the terminal and getting the information of file

Hi guys

The following script I am using for getting the information of start_frame, end_frame, width & Height of the given scene. This is working in the nuke GUI.

My problem is that I need to run this script through the terminal without opening GUI of nuke
I gave the following command

COMMAND:
/usr/local/Nuke6.0v6/Nuke6.0 -t test.py /home/narasimham.k/Desktop/test/test.py /home/narasimham.k/Desktop/test/test.nk

ERROR:
Nuke 6.0v6, 64 bit, built May 18 2010.
Copyright (c) 2010 The Foundry Visionmongers Ltd. All Rights Reserved.
lut files registration executed
/home/narasimham.k/Desktop/test/test.py
Traceback (most recent call last):
File "test.py", line 5, in <module>
nuke.scriptOpen(sys.argv[1])
RuntimeError: Syntax error at "1"
Syntax error at "1"

########### test.py
import nuke
import sys

nuke.openScript(sys.argv[1])
#nuke.scriptReadFile(sys.argv[1])
print str(int(nuke.root()[‘first_frame’].getValue()))
print str(int(nuke.root()[‘last_frame’].getValue()))
print nuke.root()[‘format’].value().width()
print nuke.root()[‘format’].value().height()

Please help me

No Responses to “reading nuke script from the terminal and getting the information of file”

Post a Comment