Skip to content

sisoe24/nukeserversocket

Repository files navigation

1. nukeserversocket README

Main Build Pre Release Last commit license

issues pull-request Codacy Badge Codacy Badge

NukeTools x x

A Nuke plugin to run code from external applications.

1.0.0 Release

This is the first stable release of nukeserversocket. It is a complete rewrite of the previous version cleaning up the code and improving the overall performance. The main goal of this release was to make the plugin more stable and easier to maintain. The plugin is now more extendable and easier to implement in other applications as well.

For a full list of changes, see the CHANGELOG

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

Important Update: Repository Name Change

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

This also means that you will need to update the import statement in your menu.py file. See Installation


1.1. Features

  • Receive Python or BlinkScript code from any client in your local network. (More on Extendibility)
  • Connect more than one client to the same Nuke instance.

1.2. Client applications

Client applications that use nukeserversocket:

  • Nuke Tools - Visual Studio Code extension.
  • Nuke Tools ST - Sublime Text package.
  • DCC WebSocket - Visual Studio Code Web extension. Note: I am not actively maintaining this extension anymore.

1.3. Installation

  1. Download the repository via the releases page or by cloning it from GitHub.
  2. Place the folder inside the ~/.nuke directory or into a custom one.
  3. Then, in your menu.py, write
    from nukeserversocket import nukeserversocket
    nukeserversocket.install_nuke()

If you use Nuke Tools, use the command Nuke Tools: Add NukeServerSocket.

1.4. Usage

Execute Code

  1. Open the nukeserversocket panel inside Nuke, and start the server by clicking Connect.
  2. You can now send code from Visual Studio Code with Nuke Tools or any other method you prefer.

NOTES:

  • 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.

1.5. Settings

You 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 output 12: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.

1.6. Extendibility

The plugin essentially works as a server socket that waits for incoming requests. Once a request is received, it performs the required operations within Nuke and sends back the result. This plugin is not tied to any specific application, which means it is easy to implement a new client without having to modify the nukeserversocket source code. All the client needs to do is send the data to the specified address within nukeserversocket.

If you wish to create a new client or contribute to the existing ones, you can find more information on the wiki page

1.8. Known Issues

  • 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.

1.9. Compatibility

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