Skip to content

Remove ResourceImporterScene singletons in favor of local usage #107855

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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.

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.

1 participant