UI Plugin to connect to external shader editor?

I have an external windows graph-based shader editor which I would like to connect to Unity via a simple plugin.

  • The plugin would need to run my simple C++ functions which creates a connection to my editor.
  • Then I would need Unity to call one of its functions in an idle loop. This function basically checks for messages coming from my editor. For example, when the user makes a code change to their shader in my editor, it would signal Unity to compile the shader, and perhaps send back any compile errors.
  • And most importantly, once the shader is changed in my app, I would like to signal Unity to save off a snapshot of the viewport, size it and send it back as raw data to my app. Idealy, to get snapshots for each block in my graph, I would be able to set a global shader constant from the plugin, have unity render, save that snapshot, and do this for all the blocks and send those snapshots back to the editor.

Is this all possible? ( creating a plugin that gets ran continuously or on idle, can set global shader constants, tell the viewport to re-render, take viewport snapshots, tell the shader to re-compile or triger Unity to check as it already does when in focus, and get access to compile errors?

Thanks you!

Scott

1 Answer

1

Look about the unity Editor classes and functions.

You’re going to have to use C#'s Process class or something like it. Consider making it entirely in C# as an editor window for unity. This seems like a really roundabout way to go when you can fiddle directly with Unity’s windows and things.