-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
Import assets before loading editor plugins #57270
Import assets before loading editor plugins #57270
Conversation
1e70a02
to
c7e6433
Compare
That's an interesting approach that should indeed solve most situations. We need to check whether it's actually mandatory for editor plugins to reside in the |
Yeah, that occurred to me after submitting this PR as well. I believe this is in fact the case, based on a tweet Juan made a while ago: https://twitter.com/reduzio/status/1418659366438309896?s=20 |
c7e6433
to
04d5135
Compare
I've changed my approach, to be more flexible with addon locations. I'd be surprised if things still work properly after this, though, since I don't fully understand the code here. Feedback from plugin wizards would be appreciated. |
The idea in general is that addons for these kinds of things should slowly be deprecated in favor of extensions, and there should be a way for scripts to be able to do this beforehand too. I think this needs a bit more discussion so it can be done in a cleaner way. |
Do you mean that editor plugins with custom importers should be deprecated in favor of native extensions? If so, I think assets should still be loaded first, in case a native extension tool loads an asset. Sorry in advance for not understanding this better. |
653ae15
to
b6867b8
Compare
Take 2: This time, the addons folders are scanned first by the EditorFileSystem, then addons (including import plugins) are loaded, then the EditorFileSystem is updated and scans the rest of the project. This approach should prevent the regressions present in 1963c63.
b6867b8
to
14ecad4
Compare
I'm wondering if a better approach might be to treat the filesystem like an optional cache, if the first scan isn't complete. What I mean by that is, when a resource is being loaded, check to see if it's been imported, but if it hasn't, and the first scan isn't complete, then try to import it. I don't believe this would cause any more slowdown than the approach currently here, since all assets used by editor plugins would have to be imported first anyways. |
Since this doesn't seem to be a great solution, I'm going to close my pull request. If there's anything different I can do in the future to help fix the bug, please let me know! |
Hopefully fixes #36713!
This time, the addons folder is scanned first by the EditorFileSystem, then addons (including import plugins) are loaded, then the EditorFileSystem is updated and scans the rest of the project. This approach should prevent the regressions present in #52344: #52968 and #52995. I've tested this with an admittedly thrown together project, and I'm not experiencing them. I don't have an MRP for #36713 that works in 4.0 alpha, so I'm marking this PR as draft since I haven't tested whether it fixes what it's supposed to fix 😕 . If someone can test it, that would be great, but I probably should be keeping a separate 3.x clone on my computer anyways to use.