-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Add an editor setting to import resources while unfocused #76991
Add an editor setting to import resources while unfocused #76991
Conversation
How will this behave when resources depend on each other? For example a .gltf with external textures. If it starts importing as soon as it sees the first file being added, it will likely fail. |
I could see this being an issue already with the current import system (if you focus the editor while a large glTF scene with separate textures is being written by a 3D DCC), but this will indeed be a more common occurrence with this setting enabled. We should probably have a way to reject an import as "postponed" in this case if it doesn't fulfill certain conditions, such as the presence of other non-empty files. @fire @lyuma Does Blender write the external textures first or the |
9dd8049
to
e32c0ed
Compare
e32c0ed
to
6e8de46
Compare
Rebased and tested again, it works as expected. I've changed the reimport timer from 1.0s to 0.5s to make reimporting quicker too. |
This can be used to speed up iteration by starting the import process earlier when saving files in the project folder. This also allows getting visual feedback on changes without having to click the editor window, which is useful with multi-monitor setups. The downside is that this increases idle CPU usage and may steal CPU time from other applications when importing resources, so this is disabled by default.
6e8de46
to
ed54096
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works as expected on my end. Tested on a file with a bunch of beefy 4k textures
Thanks! |
Is it intended that the periodic scan is also performed when the editor is still in focus? |
I don't know. I didn't specifically think about this scenario while implementing this, but it is possible for an external app to update a resource in the Godot project while the editor is focused. The main situation where this can occur is when exporting something that takes a while to export from an app like Blender, alt-tab to Godot, and have the export be completed while Godot is focused. Does this work correctly when the editor is focused currently (when the new setting is disabled)? Ideally, this should always work regardless of this setting. I expect we'll need to do some tweaking of the feature added here either way, as I don't expect this first iteration to be perfect. The polling frequency may need to be made adjustable too, or even automatically determined based on the duration of the last poll (so we don't poll too often in a large project). |
I am particularly concerned about instances where godot reads an incomplete file while it is being written. A classic example is exporting a large fbx or gltf from blender and then switching to godot before it is finished writing. Except now it could happen at any time. in godot this can be very dangerous because it could refresh the scene while importing the broken file and lose data |
This can be used to speed up iteration by starting the import process earlier when saving files in the project folder. This also allows getting visual feedback on changes without having to click the editor window, which is useful with multi-monitor setups.
The downside is that this increases idle CPU usage and may steal CPU time from other applications when importing resources, so this is disabled by default.
This needs testing in various workflows, especially 3D ones with large scenes that can take a while to export. We need to make sure Godot doesn't try to import partially written files.