Skip to content
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 even when the editor window isn't focused #3252

Closed
Calinou opened this issue Sep 4, 2021 · 0 comments · Fixed by godotengine/godot#76991

Comments

@Calinou
Copy link
Member

Calinou commented Sep 4, 2021

Describe the project you are working on

The Godot editor 🙂

Describe the problem or limitation you are having in your project

Import times can be slow in complex 3D projects, especially on slower machines.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Add an editor setting to (re)import resources in the editor as soon as possible, without waiting for the user to focus the editor window again.

Upsides:

  • Reimporting is done sooner, which leads to faster iteration times. In many cases, reimporting will be finished before you even refocus on the editor window.

Downsides:

  • Increased CPU usage, which may decrease battery life and steal CPU time from other (potentially demanding) applications. This is why it should be disabled by default 🙂

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Checking for files to reimport is currently handled here: https://github.com/godotengine/godot/blob/18c0f0b3ba46caf3f6dda401362bc5993eaf7f8d/editor/editor_node.cpp#L630-L636

When the Import Resources When Unfocused editor setting is enabled, the editor should still attempt to import resources when focusing the editor window, but it should also have a timer that scans for file modifications every few seconds. (If there's already a pending import operation, it will continue to run.)

The scanning needs to be done relatively frequently to actually improve iteration times, but it shouldn't be done too often to avoid unnecessarily increasing CPU usage. Popular polling frequencies for this purpose are between 1 and 3 seconds.

If this enhancement will not be used often, can it be worked around with a few lines of script?

No, as triggering the reimport on filesystem changes needs to be done by the editor itself.

Is there a reason why this should be core and not an add-on in the asset library?

This is core editor functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants