Thanks for your help.
I’ve now managed to get a shader on a quad mesh that displays the output from the SubViewport.
Currently I have:
MyTree (root node in scene) then as children/grand-children:
Main_Cam - attached script transforms this to the same position as the editor camera.
|_ Quad Mesh - attached script gets the material override and sets the shader parameter to the texture of the SubViewport.
SubViewport - attached script gets the Editors viewport size and sets the SubViewport size to it.
|_ Camera - attached script uses the Main_Cams’ settings and transform to set its settings.
Also, the quad mesh is set to only Visual Layer 10, and the camera/subviewport set not to see it or it blanked out the entire screen even with the shader/parameter applied.
There are some issues remaining:
There was still a discrepency between the view of the cameras and the view of the SubViewport:
As you can see, the albedo texture is being stretched and isn’t 1:1 with the original scene. However I restarted the editor and it magically fixed itself, even though the editor had been restarted several times before, which I don’t like as it means I have no idea why it suddenly started working.
The Cameras can be selected by left clicking in the editor viewport, which leads to console spam: ERROR: scene/3d/camera_3d.cpp:482 - Condition “p.d == 0” is true. Returning: Point2()
I couldn’t get any method of the get_node functions to find the nodes, I tried multiple ways based on tutorials but I would always get either a null instance error, or the output would be a string of multiple editor related dialog names.
Thee only method I got to work which I know isn’t ideal was to use find_child: get_tree().root.find_child(“MainCam”, true, false));
Also ghosting is an issue, if you move the camera you see the two scenes separately.
Also is there any way to view the current framerate of a scene in the editor? I could only find information related to in-game framerates and not something to always display the framerate in the editor UI.