A Nuke plugin to run code from external applications.
This is the initial stable version of nukeserversocket. It's a total rewrite of the earlier version with the primary goal to enhance stability and simplify maintenance. Now, the plugin is more flexible and straightforward to use in different applications.
For a full list of changes, see the CHANGELOG
Important
The repository name has changed from NukeServerSocket
to nukeserversocket
. Although GitHub url seems to be case insensitive, if you have cloned the repository before, you might need to update the remote url.
git remote set-url origin https://github.com/sisoe24/nukeserversocket.git
Note
If you are using Nuke 12 or Python 2.7, you can still use the previous version of the plugin <=0.6.2
from the releases page
- Receive Python or BlinkScript code from any client in your local network.
- Connect more than one client to the same Nuke instance.
Client applications that use nukeserversocket:
- Nuke Tools - Visual Studio Code extension.
- nuketools.nvim - Neovim plugin.
- Nuke Tools ST - Sublime Text package.
- DCC WebSocket - Visual Studio Code Web extension (deprecated at the moment).
You can create a custom client in any programming language that supports socket communication. The client sends the code to the server, which then executes it in Nuke and sends back the result. For more information, see the wiki page
# ... your socket code
data = {
"text": "print([n.name() for n in nuke.allNodes()])",
"file" : "path/to/file.py",
"formatText": "0"
}
s.sendall(bytearray(json.dumps(data), 'utf-8'))
data = s.recv(1024)
s.close()
nodes = json.loads(data.decode('utf-8').replace("'", '"'))
for node in nodes:
print(node)
- Download the repository via the releases page or by cloning it from GitHub.
- Place the folder inside the ~/.nuke directory or into a custom one.
- Then, in your menu.py, write
from nukeserversocket import nukeserversocket nukeserversocket.install_nuke()
Note
If you use Nuke Tools, use the command Nuke: Add Packages
then select nukeServerSocket.
- Open the nukeserversocket panel inside Nuke, and start the server by clicking Connect.
- You can now send code from Visual Studio Code with Nuke Tools or any other method you prefer.
Note
If you receive a message: "Server did not initiate. Error: The bound address is already in use", change the port to a random number between 49152
and 65535
and try again.
You can access the settings from the plugin toolbar.
-
Mirror To Script Editor: Allows mirroring the input/output code to the internal script editor.
-
Format Text: The script editor output window will receive a formatted version of the code result. The available placeholders are:
%d
: Time%t
: The code result%f
: The full file path%F
: The file name%n
: A new line
Format Text Example:
%d - %t%n
will output12:00:00 - Hello World!
in the script editor output window. -
Clear Output: The script editor output window will clear the code after each execution.
-
Server Timeout: Set the Timeout when clicking the Connect button. The default value is
10
minutes.
- Changing workspace with an active open connection makes Nuke load a new plugin instance with the default UI state. So it would look as if the previous connection has been closed, whereas in reality is still open and listening. To force close all of the listening connections, you can:
- Restart the Nuke instance.
- Wait for the connection timeout.
Nuke version: 13, 14, 15
While it should work the same on all platforms, I have tested the plugin only on:
- Linux:
- CentOS 8
- macOS:
- Mojave 10.14.06
- Catalina 10.15.07
- Monterey 12.6.3
- Windows 10
If you have any suggestions, bug reports, or questions, feel free to open an issue or a pull request. I am always open to new ideas and improvements. Occasionally, I pick something from the Projects tab, so feel free to check it out.