1. dcc-websocket-web README
Execute code from Visual Studio Code Browser application https://vscode.dev inside your DCC favorite package.
- Currently, I have made a WebSocket server only Nuke and planning to make one for Maya and Houdini. Feel free to request if you think you might find it useful for your software.
- The extension is in a very early development stage, where I am mostly experimenting with things in vscode.dev.
A WebSocket client for data transfer from the localhost to Visual Studio Code Web application. This extension comes in handy when coding on the fly on machines where you cannot install external applications but need a decent text editor.
A running WebSocket server is necessary for the connection.
If you are a Nuke user, you can use NukeServerSocket
>= 0.5.0 by switching the connection mode in the settings to WebSocket.
Once the server is up and running, you should specify the server port in the extension settings. Then you can send the code via the command from the command palette:
DCC: Send Code.
1.5. Make your WebSocket client
The extension sends and wraps the message data a stringified associative array with two keys:
text: with the contents of the currently active file
file: with the path of the currently active file.
Here is an example if your server is in Python (most likely)
async def server(websocket):
data = await websocket.recv()
data = json.loads(data)
code = data.get('text')
file = data.get('file')
# Send the message back to the extension to be shown
# in the output window
# host should always be localhost and
# port should match server<->client
start_server = websockets.serve(server, 'localhost', 54321)
You can also go the PyQt/PySide2 route.
If you need more information, feel free to leave a message.
1.6. Available Extension Commands
All commands are available by opening the Command Palette (
Command+Shift+P on macOS and
Ctrl+Shift+P on Windows/Linux) and typing in one of the following Command Name:
DCC: Send code
|Send code to socket
By default, the extension does not provide any shortcut. But you can assign each command to one. (see Key Bindings for Visual Studio Code for more information)
1.7. Extension Settings
Specify the server port for the connection.
Clear the previous console output text.
Show network debug information in the output window. Enabling this option will prevent the console from being cleared after code execution.
1.8. Known issues
- Currently, the extension can only connect to local host (same computer).