Remove ResourceImporterScene singletons in favor of local usage #107855
+63
−108
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 byEditorNode
, which used a boolean to indicate that these should become singletons. The singletons were only ever used in one place, bySceneImportSettingsDialog
, which had a lot of code duplication for choosing between the singletons. The only other usage ofResourceImporterScene
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 ofResourceImporterScene
, configuring it as needed. This was always the goal before I opened #87787, I just didn't prioritize this before now.