Skip to content

Conversation

@aaronfranke
Copy link
Member

This PR continues the work that #87787 started.

In the current master, ResourceImporterScene has two singletons registered, one for importing as Scene and one for importing as AnimationLibrary. These were created by EditorNode, which used a boolean to indicate that these should become singletons. The singletons were only ever used in one place, by SceneImportSettingsDialog, which had a lot of code duplication for choosing between the singletons. The only other usage of ResourceImporterScene is in the tests.

The existing code is quite a mess of spaghetti, and makes it harder for us to add non-scene-or-animation import types. Luckily, the fix is fairly straightforward: Get rid of the singletons, and make SceneImportSettingsDialog instead work with its own local copy of ResourceImporterScene, configuring it as needed. This was always the goal before I opened #87787, I just didn't prioritize this before now.

@aaronfranke aaronfranke force-pushed the scene-import-no-singleton branch from 9620d19 to e7e0279 Compare August 23, 2025 17:10
Copy link
Member

@KoBeWi KoBeWi left a comment

Choose a reason for hiding this comment

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

The code looks fine.

I'm not that familiar with scene import, so I didn't test it.

@KoBeWi KoBeWi modified the milestones: 4.x, 4.6 Aug 23, 2025
@aaronfranke aaronfranke force-pushed the scene-import-no-singleton branch from e7e0279 to aef3379 Compare August 23, 2025 17:15
@aaronfranke aaronfranke force-pushed the scene-import-no-singleton branch from aef3379 to da2c9de Compare September 25, 2025 03:26
@aaronfranke aaronfranke force-pushed the scene-import-no-singleton branch from da2c9de to e7d6524 Compare September 25, 2025 13:09
@aaronfranke aaronfranke force-pushed the scene-import-no-singleton branch from e7d6524 to 231addf Compare October 14, 2025 01:57
@aaronfranke aaronfranke force-pushed the scene-import-no-singleton branch from 4f86754 to 6c516a2 Compare October 31, 2025 14:13
@akien-mga akien-mga merged commit d23401b into godotengine:master Nov 1, 2025
20 checks passed
@akien-mga
Copy link
Member

Thanks!

@aaronfranke aaronfranke deleted the scene-import-no-singleton branch November 1, 2025 23:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment