Skip to content

Conversation

@altamkp
Copy link
Contributor

@altamkp altamkp commented Aug 29, 2024

Implementation of the following feature request: godotengine/godot-proposals#10587

@vaner-org
Copy link
Contributor

vaner-org commented May 28, 2025

I'd really like to see this feature in-engine. I have a follow up to this commit that adds some additional functionality, to make it more like Play This Scene:

  1. If the scene has no root, then the option is greyed out.
  2. If the scene is unsaved, the file is saved and then set as main scene.

set-main-scene-tab-menu

Unfortunately I worked on it before looking up if there was already a PR for this.

@KoBeWi
Copy link
Member

KoBeWi commented Jun 15, 2025

Needs rebase due to conflicts.

If the scene has no root, then the option is greyed out.
If the scene is unsaved, the file is saved and then set as main scene.

I think having no root node is fine if the scene is saved. The current editor state is irrelevant if the file is a valid scene.

@vaner-org
Copy link
Contributor

vaner-org commented Jun 16, 2025

I think having no root node is fine if the scene is saved. The current editor state is irrelevant if the file is a valid scene.

At the moment it isn't possible to right-click on a scene tab without also making it the currently selected scene in the editor. "Play This Scene" also currently relies on the current editor state to check if there is no root node, so I was trying to mimic its functionality. Should I fork this to a new PR for the rebase?

@KoBeWi
Copy link
Member

KoBeWi commented Jun 16, 2025

"Play This Scene" also currently relies on the current editor state to check if there is no root node

Maybe it's related to the fact that running the project will auto-save scenes? idk, but it could be reconsidered.

@vaner-org
Copy link
Contributor

vaner-org commented Jun 18, 2025

Seems I misremembered, looked over the code again.
bool no_root_node = !EditorNode::get_editor_data().get_edited_scene_root(tab_id);
So it does consider the currently selected tab's id, and does not reference the current editor state. I think if right-clicking a tab without also setting it as the current tab becomes possible, then this should continue to work as expected. Would be happy to work on that next.

@Repiteo
Copy link
Contributor

Repiteo commented Nov 17, 2025

Superseded by #107652

@Repiteo Repiteo closed this Nov 17, 2025
@Repiteo Repiteo removed this from the 4.x milestone Nov 17, 2025
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.

Add "Set as Main Scene" to EditorSceneTabs context menu

5 participants