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

Fix VoxelGI saving VoxelGIData as a built-in file, despite being prompted to save it to an external file #78772

Merged
merged 1 commit into from
Jul 12, 2023

Conversation

MineBill
Copy link
Contributor

This fixes #50029.

It seems like the resource saver will change the VoxelGIData resource path to the external file, save the resource and the revert it to what it was previously (an empty string), essentially creating two resources, one built-in to the scene (which has the actual data) and the external file. I do not know why the resource saver works this way, but the ScriptCreateDialog does the same thing:

String lpath = ProjectSettings::get_singleton()->localize_path(file_path->get_text());
scr->set_path(lpath);
Error err = ResourceSaver::save(scr, lpath, ResourceSaver::FLAG_CHANGE_PATH);
if (err != OK) {
	alert->set_text(TTR("Error - Could not create script in filesystem."));
	alert->popup_centered();
	return;
}

so I copied that.

@Calinou Calinou added this to the 4.2 milestone Jun 28, 2023
@Calinou Calinou added cherrypick:4.0 cherrypick:4.1 Considered for cherry-picking into a future 4.1.x release labels Jun 28, 2023
Copy link
Member

@Calinou Calinou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally, it works.

image

@YuriSizov YuriSizov merged commit 4d862d6 into godotengine:master Jul 12, 2023
@YuriSizov
Copy link
Contributor

Thanks! And congrats on your first merged Godot pull-request!

Please consider using feature branches in the future. If you make changes directly to your master, it can be hard to resolve problems. Plus, having feature branches allows you to work on several PRs at the same time, should you consider contributing again :)

@YuriSizov YuriSizov removed the cherrypick:4.1 Considered for cherry-picking into a future 4.1.x release label Aug 31, 2023
@YuriSizov
Copy link
Contributor

Cherry-picked for 4.1.2.

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