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

Allow running the resource importing process manually instead of automatically #9852

Open
Souchy opened this issue May 30, 2024 · 1 comment

Comments

@Souchy
Copy link

Souchy commented May 30, 2024

Describe the project you are working on

Any

Describe the problem or limitation you are having in your project

The import process currently runs constantly in the background, scanning files for modifications and importing them.

In projects where you add a lot of assets this:

  • slows down the editor permanently as you add more and more assets
  • takes a long time,
  • stops you from interacting with the editor while the import popup is up,
    • ie. this can popup before you have time to change your import settings, meaning now you have to run it twice.

Some things are good to automatically rescan, like when duplicating/moving/renaming a file or modifying scripts externally.
But they should all have their own option like text_editor/behavior/files/auto_reload_scripts_on_external_change.

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

  1. Add an option to make the import process completely manual, automatic like now, or run at a set interval.
  2. Add a context menu button in the file explorer to run the process on selected folders and files.

Having this means:

  • The editor should run faster without the constant rescanning of 10s of 1000s of files
  • Ability to choose exactly what to scan, meaning the process itself is faster

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

Add the editor or project option: editor/import/scan_process = [Automatic, Manual]
And a scan/import button:

  1. Add a menu option: FileMenu::FILE_IMPORT
  2. In FileSystemDock::_file_and_folders_fill_popup:
p_popup->add_icon_item(get_editor_theme_icon(SNAME("Import")), TTR("Import selected"), FILE_IMPORT);
  1. In FileSystemDock::_file_option:
case FILE_IMPORT: {
	// Scan & import files
	for (int i = 0; i < p_selected.size(); i++) {
                scan(p_selected[i];
	}
} break;
  1. Modify the EditorFileSystem::scan and EditorFileSystem::_scan_filesystem function to allow one or a list of paths to scan.

I see that Juan removed this in 2017, it would be good to have a form of it back 😃 but with improvements to run it on selected paths
image
godotengine/godot@0f7af4e#diff-ad87f37b9328524f59e7b09f722ca25a46d066216418ae50de3eae435d13b52fL491

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

No

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

Requires core modifications.

@Calinou
Copy link
Member

Calinou commented May 30, 2024

There might be good reasons not to allow this due to the inconsistent state the editor could be left in if the user doesn't reimport modified resources for a long time. If we're not careful, we run the risk of things like data loss occurring.

godotengine/godot#76991 likely addresses parts of the concerns outlined here, as the import process will begin before you've refocused the editor. The editor will still not be interactable while resources are importing, but it's more likely the import process will have finished by the time you alt-tab back to the editor.

I see that Juan removed this in 2017, it would be good to have a form of it back 😃 but with improvements to run it on selected paths

The setting had debug in its name, so I don't think it was intended for production.

@Calinou Calinou changed the title Run the import process manually instead of automatically Allow running the resource importing process manually instead of automatically May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants