I'm making a custom plugin with its own UI for the bottom panel.
The plugin UI scene has its subscenes all over the node hierarchy.
The plugin should change its contents (labels, colors, styles, textures — everything), but here's the problem.
Every time the plugin is enabled, and the subscenes' _ready() methods are called, the original scene files ends up also modified in the 2D viewport, which make it very hard to edit plugin UI scene files and test the changes after reloading the plugin.
No errors, just those scene modified in the 2D viewport.
Here's one of the cases I can describe:
- I keep my plugin UI scene opened in the 2D viewport and then enable my plugin.
- The plugin UI appears, already with texts, colors, and icons, modified (for example, every time I want to change the UI scene and scene what happens when I reload).
- I press
Reload Saves Sceneand confirm the action. - The 2D viewport now shows me the plugin UI scene with all the changes made in step 2, like if it was alwyas there.
What I've already tried:
- Checking all the node tree in the 2D viewport and the editor interface and check if the instantiated scene belongs to that viewport tree. I tried parents, children, and owners.
Engine.is_editor_hint()/is_embedded_in_editor()(neither one sees the difference between scenes in 2d viewport and scenes added into EditorInterface as plugin UI)loading insteand ofpreloading the scene
Googling the problem gave me nothing but forum topics about plugin changing what's already there in the viewport. Sadly, that's not what my problem is about.
So I've got a question: how could the editor separate the plugin's UI scene file from its instance added in the editor UI?
Technical Information:
- Godot v4.4.1.stable.flathub [49a5bc7b6]
- GDScript only
- Linux Mint 22