NukeServerSocket v1.5


 
This location is for Registered Users Only.
Perhaps you need to login or register.
Contributor: Virgil Sisoe
A Nuke plugin that will allow code execution from the local network.
Requirements:
13.1, 12.2, 11.3 or later
Linux, Mac, Windows
26 Feb 2022
115

1. NukeServerSocket README

Main BuildPre ReleaseLast commit

issuespull-request

Codacy BadgeCodacy BadgeDeepSource

license

xx

A Nuke plugin that will allow code execution from the local network via TCP/WebSocket connections and more.

Changelog

v0.5.0 2022-02-25

  • WebSocket communication protocol for browser-based text editors.
  • Fixed: Python2 code execution when using the Nuke Internal engine..

v0.4.1 2022-02-18

  • Switch code execution engine settings.

v0.4.0 2022-02-17

  • Intercept exceptions inside Nuke's thread to extension output.
  • Configurable timeout settings.
  • Display timeout timers in UI.

v0.3.0 2022-02-06

  • Various fixes and optimizations for code execution.

v0.2.0 2021-10-29

  • Connections timeouts.
  • Various fixes and optimizations.

v0.1.0 2021-09-23

  • Execute BlinkScript code.
  • Send/Receive Nodes from another instance.
  • New About widget.
  • API now accepts also simple strings when sending a request.
  • Under the hood optimizations.

1.1. Client applications

Client applications that can use NukeServerSocket:

1.2. Features

  • Send Python or BlinkScript code to be executed inside Nuke from your local network.
  • Multiple computers can connect to the same Nuke instance.
  • Receive/Send nodes from another Nuke instance in your local network.
  • Not bound to any application. (more on Extendibility)
  • WebSocket compatible for browser-based text editors.

1.3. Installation

Save the plugin in your .nuke directory or in a custom directory and then import NukeServerSocket in your menu.py.
Remember: If you use a custom plugin path, add the path in your init.py: nuke.pluginAddPath('custom/path').

N.B. if your downloaded zip folder has a different name (NukeServerSocket-master, NukeServerSocket-0.0.2 etc._), then you need to rename it to just NukeServerSocket.

1.4. Usage

1.4.1. Receive incoming request

Demo

Open the NukeServerSocket panel and with the mode on Receiver, start the server by clicking Connect.

If you receive a message: 'Server did not initiate. Error: The bound address is already in use', just change the Port to a random number between 49152 and 65535 and try again. It means that probably you have a connection listening on that port already. Also when connected, you could test the receiver with the Test Receiver button.

When connected, NukeServerSocket will listen for incoming request on the IP Address and Port shown in the plugin.

Now you can send code from Visual Studio Code with Nuke Tools or any other method you prefer.

1.4.2. Receive/Send nodes

Demo

1.4.2.1. Send

When sending nodes, switch the mode from Receiver to Sender and be sure that there is another NukeServerSocket instance listening for incoming network request (Receive incoming request). Select the nodes you want to send a click Send Selected Nodes.

By default, the IP Address on the sender points to the local IP address, so, if you want to send nodes between the same computer, you should only specify the Port. When sending nodes to another computer, you will also need to specify the IP Address of the computer you want to send the nodes.

1.4.2.2. Receive

When receiving nodes just follow the steps for Receive incoming request for the receiving instance and the Send steps for the sending instance.

1.5. Settings

The settings can be accessed from the plugin toolbar

  • Code Execution Engine: Change the engine that is executing the code.

    • Nuke Internal: Nuke executeInMainThread function.
    • Script Editor: Nuke Script Editor widget.
  • Connection Type: Change the internal connection protocol for the client-server.

    • TCP: The default type of connection. If unsure, use this.
    • WebSocket: Similar to the TCP, allows two-way interactive communication session between the user's browser and the internal server. Use this when using a browser-based text editor.

    Changing connection type while connected, could cause some errors.

  • Mirror To Script Editor: Allows to mirror the input/output code to the internal script editor.

    • Override Output Editor: Mirror output to the internal script editor.
    • Format Text: The script editor output window will received a formatted version of the code result.
    • Clear Output: The script editor output window will clear the code after each execution.
    • Show File Path: The script editor output window will display the full file path of the file being executed.
    • Show Unicode: The script editor output window will display a unicode character `` that indicates the start of the code execution result.
    • Override Input Editor: Mirror input to the internal script editor.
  • Timeout: Terminate the connection when the server is inactive or it wasn't able to establish a successful connection, in the time specified.

    • Server: Set the timeout when clicking the Connect button. Defaults to 10 minutes.
    • Receiver: Set the timeout for when clicking the Test Receiver button. Defaults to 10 seconds.
    • Send Nodes: Set the timeout when clicking Send Nodes button. Defaults to 30 seconds.

1.6. Extendibility

At its core, the plugin is just a server socket that awaits for an incoming request, performs the operations inside Nuke and returns the result. Nothing ties it to any application per se.

This makes it very easy to implement a new client, without the need to modify NukeServerSocket source code. The client needs only to send the data at the specified address inside NukeServerSocket.

More information and examples on the wiki page.

1.7. Test plugin locally

The plugin can be launched locally outside the Nuke application. This is useful for testing code and implementing new features more rapidly.

More information on the wiki page.

1.8. Known Issues

  • Creating a modal window with the Nuke internal code execution engine, will cause Nuke to freeze. A workaround is to switch to the Script Editor engine.
  • Settings window doesn't display the tooltip text.
  • When changing workspace with an active open connection, Nuke will load a new plugin instance with the default UI state. This would look as if the previous connection has been closed, where in reality is still open and listening. One way to force close all of the connections is to restart Nuke, or you can wait for the connection timeout.

1.9. Compatibility

Nuke version: 11,12, 13.

Because Nuke 11 uses an early version of PySide2, future compatibility is not a guarantee.

While it should work the same on all platforms, it has been currently only tested on:

  • Linux:
    • CentOS 8
  • MacOS:
    • Mojave 10.14.06
    • Catalina 10.15.07
  • Windows 10

1.10. Demo

Execute code from Visual Studio Code

Execute Code

Send nodes

Send Nodes

MIT License Copyright (c) 2021 Virgil Sisoe Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Please login in order to download these files.

Comments   

 
0 # mani di 2021-08-01 09:45
Amazing stuff! Thank you!

note: you have a misspell a bit github link (colon missing)
 
 
0 # sankara rao potnuru 2022-01-23 19:51
Very useful, Thank you.
 

You have no rights to post comments

We have 2559 guests and 143 members online