There is a reason I removed the "shell=True" kwarg from your Popen call in my 
previous email...

The following code works fine (assuming you have all the necessary 
modules/packackes on your system PYTHONPATH, and you change the paths in the 
subprocess call appropriately):


import subprocess
import nukeExternalControl.client

print "Starting Nuke Server"
np = subprocess.Popen(["C:\\Path\\To\\Nuke\\Nuke6.3.exe", '-t', 
"C:\\Path\\To\\PythonPath\\nukeExternalControl\\server.py"])
conn = nukeExternalControl.client.NukeConnection()
nuke = conn.nuke
print "execute commands"
nuke.root().knob('first_frame').setValue(1)
nuke.root().knob('last_frame').setValue(10)


If it doesn’t, your firewall is probably blocking the port it’s trying to use.

-Nathan



From: Manley 
Sent: Monday, February 27, 2012 5:38 PM
To: [email protected] 
Subject: [Nuke-python] Re: Nuke Module External Python Shell

The python script is as such:


np = subprocess.Popen(['X:\\apps\\Nuke6.1v5\\Nuke6.1.exe', '-t', 
r'X:\apps\Scripts\NUKE\nukeExternalControl\server.py'], shell=True)

print "Starting Nuke Server"
import nukeExternalControl.client
conn = nukeExternalControl.client.NukeConnection()
nuke = conn.nuke
print "execute commands"
nuke.root().knob('first_frame').setValue(1)
nuke.root().knob('last_frame').setValue(10)






The error I'm getting is this:



['eur512_029_040_031(dpx) 1-1', 'eur512_029_040_031(jpg) 1-10']
Running Nuke
Starting Nuke Server
Nuke 6.1v5, 64 bit, built Feb 11 2011.
Copyright (c) 2010 The Foundry Visionmongers Ltd. All Rights Reserved.
SERVER: Checking port 54200
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Python27\lib\lib-tk\Tkinter.py", line 1410, in __call__
return self.func(*args)
File "C:\Users\manley\Desktop\man\testCapture.py", line 338, in runNuke
conn = nukeExternalControl.client.NukeConnection()
File "C:\Python27\nukeExternalControl\client.py", line 45, in __init__
raise NukeConnectionError("Connection with Nuke failed")
NukeConnectionError: Connection with Nuke failed


--------------------------------------------------------------------------------
_______________________________________________
Nuke-python mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
_______________________________________________
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