How to render editor scene nodes in another window?

Godot Version

4.7

Question

I’m working on a plugin for Godot I’m creating that has a main screen window. This window is a 3D scene, and I’d like to be able to render parts of the scene as it appears in Godot’s regular 3D editor window in my plugin window. I can get the root of the editor’s scene graph with EditorInterface.get_edited_scene_root(), but am unsure how to render the nodes in the tree.

I was reading through the RenderingServer docs and it looks like node instances are bound to their World3D - so if I wanted to display them in my window, I’d need to create new instance objects that used my windows viewport and scenerio. Am I right here, or is there something else I’d need to do to draw the edited scene’s nodes in my separate window?

Parent a 3d camera node to the window node.

I don’t understand what you mean. I’ve added a camera to it, but the scene is otherwise empty. The nodes I want to render are in a completely separate window.

If the windows share the world the camera should see the scene.