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

Suppress surface upgrade warnings when showing SurfaceUpgradeTool warning #85249

Merged
merged 1 commit into from
Nov 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions editor/surface_upgrade_tool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ void SurfaceUpgradeTool::_try_show_popup() {
} else {
singleton->_show_popup();
}
RS::get_singleton()->set_warn_on_surface_upgrade(false);
}

void SurfaceUpgradeTool::_show_popup() {
Expand Down Expand Up @@ -122,11 +123,13 @@ void SurfaceUpgradeTool::finish_upgrade() {

// Update all meshes here.
Vector<String> resave_paths = EditorSettings::get_singleton()->get_project_metadata("surface_upgrade_tool", "resave_paths", Vector<String>());
EditorProgress ep("surface_upgrade_resave", TTR("Upgrading All Meshes in Project"), resave_paths.size());
Vector<String> reimport_paths = EditorSettings::get_singleton()->get_project_metadata("surface_upgrade_tool", "reimport_paths", Vector<String>());
EditorProgress ep("surface_upgrade_resave", TTR("Upgrading All Meshes in Project"), resave_paths.size() + reimport_paths.size());

int step = 0;
for (const String &file_path : resave_paths) {
Ref<Resource> res = ResourceLoader::load(file_path);
ep.step(TTR("Attempting to re-save ") + file_path);
ep.step(TTR("Attempting to re-save ") + file_path, step++);
if (res.is_valid()) {
// Ignore things that fail to load.
ResourceSaver::save(res);
Expand All @@ -135,7 +138,6 @@ void SurfaceUpgradeTool::finish_upgrade() {
EditorSettings::get_singleton()->set_project_metadata("surface_upgrade_tool", "resave_paths", Vector<String>());

// Remove the imported scenes/meshes from .import so they will be reimported automatically after this.
Vector<String> reimport_paths = EditorSettings::get_singleton()->get_project_metadata("surface_upgrade_tool", "reimport_paths", Vector<String>());
for (const String &file_path : reimport_paths) {
Ref<ConfigFile> config;
config.instantiate();
Expand All @@ -150,6 +152,8 @@ void SurfaceUpgradeTool::finish_upgrade() {
continue;
}

ep.step(TTR("Attempting to remove ") + remap_path, step++);

String path = OS::get_singleton()->get_resource_dir() + remap_path.replace_first("res://", "/");
print_verbose("Moving to trash: " + path);
err = OS::get_singleton()->move_to_trash(path);
Expand Down
Loading