godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.14k stars 96 forks source link

Don't switch to 2D view when selecting a control node that is child of a SubViewport #8150

Open elthundercloud opened 1 year ago

elthundercloud commented 1 year ago

Describe the project you are working on

3D Adventure game with a lot of level-specific texts and signs in the world

Describe the problem or limitation you are having in your project

Every time I click on a control node, the editor takes me from 3D view to 2D view. Previewing subviewports is impossible: #5422; That means I need to switch back to 3D view every time I select a node to see the changes I'm making, which is tedious with big control trees.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Either implement subviewport preview in 2D context or do not switch to 2D context at all when selecting a control node that is a child of a subviewport. The solution should not break regular GUI editing, it should still automatically switch to 2D context unless the root is a subviewport.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

A simple recursive parent check will probably suffice. As for the preview implementation: #5422

If this enhancement will not be used often, can it be worked around with a few lines of script?

Core feature.

Is there a reason why this should be core and not an add-on in the asset library?

Basic UX.

Mickeon commented 1 year ago

Getting to fix the issue outright by actually having a preview sounds like the more natural issue. If this exception is made it would have to be removed later anyway, which may go unnoticed.

KoBeWi commented 1 year ago

The current solution for not being able to edit the nodes inside viewport is https://github.com/godotengine/godot/pull/74573 This proposal can be solved independently (i.e. only switch view when the node is under currently edited viewport).

That said, editor switching is handled by EditorNode using generic main screen plugin code. Making it aware of viewports might require some hacks.