Additions for the Script Editor Web Socket
WolfGang Senizen
There are a few function that would be good to have through the viewer web socket for smoother integration with external editors.
Requests - web socket endpoints
- List Open script editors with editor id's(This is sort of done, but only open scripts that are also currently externally edited it might be nice to list all open ones)
- Get currently selected object id
- List content asset id, asset type, nameof anobject idto allow for opening scripts
- Open script editor by asset idto open a script from an object returneditor id
- Get contents of open script editor by editor id
- Get object id, assetfor an open script editor byeditor id
- Send contents to and open editor by editor idto save
Events - Things the socket can announce to subscribers
- New object selected - object id, inventory content
- New script editor opened - editor id, object id, asset, text content
General
- Add config to allow the websocket to be opened when editing even if there are no scripts open yet, to allow for external tools to sync to viewer when it starts editing, and stay open if there are still subscriptions after, as it currently does.
Given these endpoints it should be possible to make a fairly integrated setup in any editor, that would allow you to open related scripts and edit them seamlessly, and would also allow bypass the fiddly aspect of dealing with the current temp file system.
For instance the current vs code plugin could list a virtual workspace that represents the sl viewer, and show a tree view of object content for the user to open and edit.
Log In