godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.12k stars 69 forks source link

Add a combined 2D/3D viewport tab next to (2D 3D Script AssetLib) to allow editing and previewing 2D and 3D nodes together #6935

Open golddotasksquestions opened 1 year ago

golddotasksquestions commented 1 year ago

Describe the project you are working on

This applies to any 3D project with 2D elements like UI, HUDs, or post process effects (so pretty much all 3D projects)

Describe the problem or limitation you are having in your project

There are hardly any 3D projects without 2D elements. By 2D I mean those rendered in the 2D viewport, so any node extending CanvasItem.

The problem is: In order to preview your 3D and 2D elements together, you always have to run the project. This gets a lot worse whenever you have to edit your 2D and 3D elements together in correspondence with each other. For example shift the position of an object or change it's color - run the scene to see how it looks together, shift and and change color again because it was not right - run the scene again ... repeat a hundred times.

This is terribly annoying for small projects and an impediment and pointless time sink at best for any serious work. (More examples outlined here)

If you try to work around this by creating a 2D utility scene with SubViewportContainer and SubViewports to render your 3D scene in 2D, you have similar problems: It this does not provide nearly the same usability as the 2D/3D viewports combined since the 3D scene has to be rendered by the scenes Camera3D node rather than the editor 3D viewport camera. You also still can't select edit of move any 3D object while also seeing the 2D elements since the editor immediately jumps to the 3D viewport when editing any 3D node. Selecting any 3D object through the 2D viewport is out of question unless the Godot user is determent to dive into weeks or months of custom tooling via EditorPlugin.

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

New editor viewport tab: image

Allows previewing, inspecting and editing both 2D objects in the 2D+3D editor viewport: image

as well as previewing, inspecting and editing 3D objects in the 2D+3D editor viewport: image

The rendered result for the 2D+3D viewport should be the same whether you have 2D nodes in a scene with a 3D root node or 3D nodes in a scene with a 2D root node. (= as it currently is when running a scene)

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

see mock-ups above

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

no

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

It is a much needed improvement to usability other engines provide out of the box.

Zireael07 commented 1 year ago

I think it's been bandied about in editor UI/UX improvements proposals, but doesn't have separate issue by itself.

AThousandShips commented 1 year ago

Related to #6713

golddotasksquestions commented 1 year ago

@Zireael07 I did quite a bit of issue plowing before starting to write this, but I could not find a similar proposal. Would you mind linking to the UI/UX improvement proposal you mean in your comment for easier navigation of the issues?

Zireael07 commented 1 year ago

Ah. That's where I saw that earlier. Note that is NOT a dupe of the other per se since each of them suggests a slightly different approach to the same problem

@golddotasksquestions @AThousandShips already linked to one of those and I'll link the other if/when I find it

AThousandShips commented 1 year ago

Duplicate of #2635?

golddotasksquestions commented 1 year ago

Duplicate of https://github.com/godotengine/godot-proposals/issues/2635?

@AThousandShips

Similar problem, but just previewing as is proposed there is not enough. Users need to be able to not just preview both 2D and 3D but also select and edit of both 3D and 2D at the same time, regardless what the type the root node of the scene is.

AThousandShips commented 1 year ago

I think blending both editing together might create more issues than help tbh (also the nature of the root of the scene isn't relevant for this)

golddotasksquestions commented 1 year ago

@AThousandShips What issues exactly? If you want to preview select or edit only 2D or only 3D objects you can still do so in their respective viewport tabs.

AThousandShips commented 1 year ago

Well the 3D and 2D editors have fundamentally different navigation needs, also the usefulness of having 2D overlays when you're doing 3D editing as opposed to previewing is questionable to me, the annoyance of accidentally selecting something far away in 3D because you missed the 2D element you wanted to click, etc.

What usefulness do you find in having 2D over the view when working on the 3D part of the scene?

Also I'll suggest the following compromise: overlaying 2D in 3D, for those who need to preview 2D while editing 3D, though I'm not sure I can see that being a common need

(Also please don't tag me when it's just the two of us talking like this, it's not needed)

golddotasksquestions commented 1 year ago

It seems to me you are missing the point.

Navigation is not an issue. We could decide for example to

a) not have 2D navigation in this 2D+3D editor viewport at all, instead just display all 2D nodes on top with a bit of margin (see mock-ups in the post above). This is essentially the same as having a CanvasLayer with GUI children. b) have 3D navigation as default but switch to the 2D navigation when pressing a modifer key c) have 2D navigation as default but switch to 3D navigation when pressing a modifer key

Personally I would like this to be configurable in the Editor Settings.

the annoyance of accidentally selecting something far away in 3D because you missed the 2D element you wanted to click, etc.

It should work just like it currently works: 2D is always rendered on top of 3D elements in Godot. Therefore if you click a 2D element, the 2D element is selected, if you click somewhere where there is no 2D element, the 3D element is selected if there is one. However I would not expect many users to use the viewport to select objects in the viewport. Viewport selection already sucks terribly in both 2D and 3D editor viewports and is mostly a gimmick if you ask me. This is not going or meant to solve or improve this.

I don't know about you, but I quickly learned selecting objects in Godot is best done through the scene panel.

The main benefit is to be able to preview select (to inspect properties, most of the time through the scene panel) and edit both of them at the same time while seeing what you are doing and what effect it has in relation to both your 2D as well as 3D elements.

also the usefulness of having 2D overlays when you're doing 3D editing as opposed to previewing is questionable to me,

If you don't have a use for this feature and don't know a solution for the problem others have either, then why are you commenting? What you are doing is not constructive.

AThousandShips commented 1 year ago

What you are doing is not constructive.

I'm making a simple statement of that I don't see any usefulness of this, not that I don't have any use of it, that's part of reviewing and commenting on feature proposals, and it is your responsibility as author to actually provide such use cases, and that's what I'm asking for

What isn't constructive is your hostile response to feedback

golddotasksquestions commented 1 year ago

Godot is a general purpose engine. If tries to fulfill a very broad spectrum of usecases. Naturally what follows is the fact that all users won't have a usecase or need for all it's features. I never have used VR part of the engine before and don't plan to either.

Using your logic would mean I should to go VR proposals and start commenting "I don't see a use for that" and downvote the proposal like you did here with my proposal.

Instead of moving on or offering solutions for the problem which is presented here (which naturally you will be bad at if you don't even have that usecase or need) you are wasting everyone's time saying exactly nothing.

Zireael07 commented 1 year ago

Viewport selection already sucks terribly in both 2D and 3D editor viewports and is mostly a gimmick if you ask me. This is not going or meant to solve or improve this.

I agree that viewport selection would probably need to be disabled in this case, otherwise I'd run fast smack dab into the issue @AThousandShips mentions (Selecting 2d where I wanted to select 3d or vice versa)

AThousandShips commented 1 year ago

you are wasting everyone's time saying exactly nothing.

Since you are unable to engage fairly and constructively in the face of constructive criticism I'll just leave, though I was going to propose several alternatives and compromises, as my feedback isn't desired, and reacting defensively against my disagreement with you and not supporting this proposal, please refer to the code of conduct

KoBeWi commented 1 year ago

Related: https://github.com/godotengine/godot/pull/51817

golddotasksquestions commented 1 year ago

@KoBeWi Yes, like https://github.com/godotengine/godot-proposals/issues/2635 also related. Thanks for sharing the link!

However also like https://github.com/godotengine/godot-proposals/issues/2635 this only covers one side and only the passive part of this proposal. Being able to inspect and edit properties of both 2D and 3D while previewing them in the same viewport is the crucial part.

aaronfranke commented 1 year ago

@golddotasksquestions That would be confusing though, how would you know if you were editing 2D or 3D items without having it explicitly selected? How would the toolbars at the top below the scene tabs handle this? How could you discern trying to deselect from 2D by clicking on an empty space from performing a raycast into the 3D scene?

I think the only reasonable solution is what https://github.com/godotengine/godot/pull/51817 is proposing, which was actually accidentally happening back when the Vulkan branch was in early development https://github.com/godotengine/godot/issues/40553

golddotasksquestions commented 1 year ago

@aaronfranke

I really have no idea why you would think this would be confusing.

It would behave exactly like the existing 2D and 3D editor viewports: If you select a node it is highlighted in the Scene Panel and in the center editor viewport and you can inspect it's properties in Inspector panel (see mock-ups above). Of course the toolbar also shows the context of the selected node. So exactly the same as it is right now in the 2D and 3D editor viewports. If none of your nodes is selected also exactly is happening: The nodes are no longer highlighted and the Inspector panel is empty.

Personally I quickly got used to only selecting nodes in the Scene Panel unless the scene is almost empty. Because Godot's mouse selection detection via the 2D or 3D viewport really sucks once you have a few overlapping objects in your scene. Same would be true here in the combined 2D+3D viewport.

Deselecting also would work exactly the same as it is now in the existing 2D and 3D viewports: If your scene is nearly empty, you press "Esc" or click an empty area of the Scene Panel or click in an empty area in the viewport. If your editor viewport is filled with elements top to bottom so you don't have an empty spot to click, either press the "Esc" key or click an empty area in the Scene Panel. If the Scene Panel is also completely filled with nodes, still pressing "Esc" will deselect your current selection. So once again, exactly the same behavior, problems, usability and solutions we have now with the 2D and 3D viewports. "Esc" always works.

If anything if is less confusing because users would finally not have their nodes suddenly disappear when they switch to selecting a different type of node.

And if they specifically want to only work in either the 3D or 2D context they can still do so in the respective 2D and 3D viewports. Having this combined 2D+3D Viewport to preview edit and select can only be a improvement in usability.

https://github.com/godotengine/godot/pull/51817 is not a solution to this issue at all. You would still have to change between the 2D and 3D editor viewports if you want to edit either type of node and being in 3D editor viewport won't show you the 2D nodes, let alone allow to edit them.

Zireael07 commented 1 year ago

@aaronfranke That's why I said viewport selecting (i.e. click to select in viewport) would have to be disabled in the combined mode.

That's different from showing selections made via other means

yosoyfreeman commented 1 year ago

If you don't have a use for this feature and don't know a solution for the problem others have either, then why are you commenting? What you are doing is not constructive.

She is commenting because is an active Godot contributor who understand the philosophy of the engine and user experience topics pretty well. She can sound a bit too serious sometimes, as me, but is ALWAYS trying to help.

As for this, can't you just run the scene with F6 and edit your 2d scene? Godot supports live editing and is what i do to do this.

you are wasting everyone's time saying exactly nothing.

Yeah, nope. I disembark here. We have a code of conduct for something. I can not, in good conscience, participate in a conversation where @AThousandShips had to leave because of the constant dehumanization. I don't think that we, as a community, should continue this conversation like nothing happened.

AThousandShips commented 1 year ago

@yosoyfreeman thank you!

yosoyfreeman commented 1 year ago

Sorry. I got angry and forgot to use He/she or they. Is corrected now.

AThousandShips commented 1 year ago

Easy mistake, thank you for correcting, using they when not sure is always a safe bet (or look at profiles)

yosoyfreeman commented 1 year ago

You are totally right. I try to, but i usually forget. Still learning. English is not my native language and here in Spain teach us in school that using "They" for a single person is wrong, so i'm still trying to un-learn that.

PD: I don't think this is offtopic. This issue is happening more as Godot grows and the thing i loved the most about this community is how inclusive it is. It is, or was, a safe space. One of the guidelines is "Assume good intention" Which is not trivial when discussing online. And i say that as an autistic person who find human interaction, specially in this kind of context, pretty hard.

We need more moderators.

Zireael07 commented 1 year ago

As for this, can't you just run the scene with F6 and edit your 2d scene? Godot supports live editing and is what i do to do this.

Live editing sounds like a convoluted workaround to many 2d in 3d scenarios (such as placing world space labels, though that specific use case is mostly solved by Label3D in 4.0, there are many other 2D in 3D scenarios much more complex)

yosoyfreeman commented 1 year ago

I see. Is a powerful system but not the easiest approach. I'm with you then. Thank you for explaining it to me.

This is my last comment here until someone with moderation privileges say something. Have a good day!

Zireael07 commented 1 year ago

Is a powerful system but not the easiest approach. I'm with you then

Exactly. I have used 2d in 3d in two different projects and while one case is covered by the Label3D, the other is much more complex (think a diegetic/interactable computer in a 3D world), and it would be MUCH easier if we could edit/preview them in editor immediately, instead of running the game only to discover something got out of viewport/something is clipped etc etc.

YuriSizov commented 1 year ago

We need more moderators.

@yosoyfreeman I think your response was great, and both you and @AThousandShips handled it very well. Thank you for your compassion and efforts to build a better community for Godot.

yosoyfreeman commented 1 year ago

Thank you for putting an eye on the issue. It must be really hard to keep control of everything with Godot growing so much.

Johnrobmiller commented 9 months ago

image

As a UX/usability designer, this is my two cents:

It would be a huge mistake to implement the UI in the screenshot (I don't actually care whether the feature is needed or not, the UI needs work here). Good usability principles dictate that a product (in general, software and otherwise) should present the simplest possible interface that serves the purposes of most number of its users. Niche features should be optionally accessed in a way that is easy to find but doesn't clutter the interface. This principle ensures that the interface doesn't baboon in complexity. However, the proposed implementation violates this principle by adding an extremely niche feature alongside non-niche features core to the program. Would it not be far better to handle this some other way?

golddotasksquestions commented 9 months ago

@Johnrobmiller I agree with you on the principle, but I don't agree with you at all that a combined 2D/3D viewport is a niche feature.

If you do a lot of work between 2D and 3D in the same project, which applies to most 3D games btw, and many 2D games with 3D elements, you will know how essential it is to judge and edit both at the same time.

Having to always run the scene to see your 2D UI on top of your 3D game is a massive waste of time and terrible user friendliness as you have to move and edit your 2D "blindly" not knowing where your 3D elements are and vice versa.

Even when using SubViewportContainers and Subviewports, making changes which depend on both 2D and 3D is impossible, because whenever you touch 3D nodes the editor viewport switches to "3D" -> without the 2D elements visible.