You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 12:30:27 +00:00
Set the VoxelGIData path before saving, otherwise the ResourceSave will revert it to an empty String
This commit is contained in:
@@ -166,8 +166,13 @@ void VoxelGIEditorPlugin::_voxel_gi_save_path_and_bake(const String &p_path) {
|
|||||||
probe_file->hide();
|
probe_file->hide();
|
||||||
if (voxel_gi) {
|
if (voxel_gi) {
|
||||||
voxel_gi->bake();
|
voxel_gi->bake();
|
||||||
ERR_FAIL_COND(voxel_gi->get_probe_data().is_null());
|
// Ensure the VoxelGIData is always saved to an external resource.
|
||||||
ResourceSaver::save(voxel_gi->get_probe_data(), p_path, ResourceSaver::FLAG_CHANGE_PATH);
|
// 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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user