Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make default main screen plugin work even if 2D and 3D are disabled in editor features #41036

Merged
merged 1 commit into from
Sep 15, 2021

Conversation

nathanfranke
Copy link
Contributor

@nathanfranke nathanfranke commented Aug 5, 2020

Note that 2D can not yet be disabled in editor features. This is a precursor to #41038

This was based on a request here by @itsraineing:

> I would recommend that either the default (eg when creating a new scene) be changed to 2D, or the 3D tab moved to be the first; it's always stricken me as a bit odd that the editor defaults to the second tab.

This PR changes the default main screen plugin to the first one that is enabled. Typically, 2D

Before:
image
After:
image

Bugsquad edit: Closes godotengine/godot-proposals#1352

Copy link
Member

@aaronfranke aaronfranke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change also gives us the opportunity to allow disabling the 2D main screen in addition to the others (currently in 3.2 and master it is force-enabled), since now the logic is no longer dependent on either the 2D or 3D main screens being enabled. The 2D viewport is not necessary in a variety of situations (ex: making command line apps in Godot, making 3D game prototypes without a GUI, making 2.5D games with the 2.5D main screen plugin, etc). This can be done in a follow-up PR (EDIT: #41038).

For this PR in particular, defaulting to 3D (as in current 3.2 and master) is rather arbitrary, so I guess it makes sense to default to whatever the first item in the list is unless someone has a reason against this. Even if we want to keep 3D as the default, the logic should still be changed to be similar to this PR, so that there are more fallbacks available.

@clayjohn
Copy link
Member

clayjohn commented Aug 5, 2020

I love it! I think this is a great idea and has little risk of breaking things.

That being said, this impacts what users see everytime they open the engine, so this really needs to be discussed in a proposal and shared around a bit before we decide what to do.

@Xrayez
Copy link
Contributor

Xrayez commented Aug 5, 2020

I confirm the usefulness of this PR, I once fixed a bug caused by having 3D main screen on a 2D project as default back in the days of 3.1: #25491.

@akien-mga
Copy link
Member

Proposal: godotengine/godot-proposals#1352

Copy link
Member

@Calinou Calinou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to Godot usage polls made in 2020, ~75-80% of users are focused on 2D. Therefore, I think this is a good change for now. It's likely that this share will remain above 50% for the foreseeable future.

We can cherry-pick this to the 3.x branch after 3.3 is released.

@KoBeWi
Copy link
Member

KoBeWi commented Mar 26, 2021

I just found this piece of code (inside READY of EditorNode):

if (!main_editor_buttons[EDITOR_3D]->is_visible()) { //may be hidden due to feature profile
_editor_select(EDITOR_2D);
} else {
_editor_select(EDITOR_3D);
}

I think it's no longer relevant after this change?

@aaronfranke
Copy link
Member

aaronfranke commented Mar 26, 2021

@KoBeWi That code is already removed by the follow-up to this PR, #41038. this PR.

@KoBeWi
Copy link
Member

KoBeWi commented Mar 26, 2021

Yeah, but it's relevant for this PR not the follow-up. We can't assume the other PR will get merged.

@sairam4123
Copy link

I'm against this PR, I work with a lot of 3D projects and everytime I make a new scene I must have to change to 3D, so please don't change this.

@aaronfranke
Copy link
Member

@sairam4123 If you click the new scene button, it keeps the same main screen you're in. This only affects new projects.

@sairam4123
Copy link

sairam4123 commented Jul 5, 2021

@sairam4123 If you click the new scene button, it keeps the same main screen you're in. This only affects new projects.

Still I have to change back to 3D everytime, I create a new project for prototype.

@aaronfranke
Copy link
Member

aaronfranke commented Jul 5, 2021

@sairam4123 When you click the "3D Scene" button in a new project, it will switch to 3D automatically. You don't have to manually switch to 3D. This only affects new projects before you create a node for the first scene (or if the root is "Node").

@YuriSizov YuriSizov requested a review from a team August 24, 2021 23:27
@reduz
Copy link
Member

reduz commented Aug 30, 2021

At some point this was discussed some years ago, and the result of the discussion was that it should be kept 3D because it looks cool when opening the engine compared to the emptiness of the 2D editor. After all, when you add the right node by creating a new scene it eventually moves to the right editor.

I made a new poll to corroborate this feeling with the community, and it seems this is still the overwhelming predominant opinion:
https://twitter.com/reduzio/status/1432447154946203650

As such, I think this Pull Request and associated proposal should be closed.

@KoBeWi
Copy link
Member

KoBeWi commented Aug 30, 2021

It was also discussed that it doesn't matter at all, because the only thing that it changes is what you see when you open a new project for the very first time. The poll you just posted is biased towards 3D and most people voting don't even understand what the change is really about and why it was brought up (from the beginning it was about removing a hard-coded editor switch and making the code simpler/more generic).

@nathanfranke
Copy link
Contributor Author

Even if we decide to show 3d by default, this PR highly simplifies the code and also supports disabling both 2d and 3d

@aaronfranke
Copy link
Member

aaronfranke commented Aug 31, 2021

@nathanfranke Yes. We can modify this PR to show 3D by default but also include the rest of the changes here that make the code more flexible. That way it will be more likely to be merged since it keeps the 3D-is-default status quo.

@nathanfranke nathanfranke force-pushed the default-2d-editor branch 2 times, most recently from bfbe60c to 404a11d Compare August 31, 2021 03:28
@nathanfranke nathanfranke changed the title Use 2D as default main screen plugin Make default main screen plugin work even if 2D and 3D are disabled in editor features Aug 31, 2021
@akien-mga akien-mga merged commit c208316 into godotengine:master Sep 15, 2021
@akien-mga
Copy link
Member

Thanks!

@nathanfranke nathanfranke deleted the default-2d-editor branch September 15, 2021 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use the 2D main screen plugin as default instead of 3D (affects empty scenes without root node)
9 participants