Skip to content

Commit

Permalink
Merge pull request #78772 from MineBill/master
Browse files Browse the repository at this point in the history
Fix VoxelGI saving VoxelGIData as a built-in file, despite being prompted to save it to an external file
  • Loading branch information
YuriSizov committed Jul 12, 2023
2 parents c457480 + c34d562 commit 4d862d6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions editor/plugins/voxel_gi_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,13 @@ void VoxelGIEditorPlugin::_voxel_gi_save_path_and_bake(const String &p_path) {
probe_file->hide();
if (voxel_gi) {
voxel_gi->bake();
ERR_FAIL_COND(voxel_gi->get_probe_data().is_null());
ResourceSaver::save(voxel_gi->get_probe_data(), p_path, ResourceSaver::FLAG_CHANGE_PATH);
// Ensure the VoxelGIData is always saved to an external resource.
// This avoids bloating the scene file with large binary data,
// which would be serialized as Base64 if the scene is a `.tscn` file.
Ref<VoxelGIData> voxel_gi_data = voxel_gi->get_probe_data();
ERR_FAIL_COND(voxel_gi_data.is_null());
voxel_gi_data->set_path(p_path);
ResourceSaver::save(voxel_gi_data, p_path, ResourceSaver::FLAG_CHANGE_PATH);
}
}

Expand Down

0 comments on commit 4d862d6

Please sign in to comment.