diff --git a/source/blender/geometry/intern/volume_grid_resample.cc b/source/blender/geometry/intern/volume_grid_resample.cc index dbcb33026c0..fd92ebddb87 100644 --- a/source/blender/geometry/intern/volume_grid_resample.cc +++ b/source/blender/geometry/intern/volume_grid_resample.cc @@ -28,6 +28,11 @@ openvdb::FloatGrid &resample_sdf_grid_if_necessary(bke::VolumeGrid &volum /* TODO: Using #doResampleToMatch when the transform is affine and non-scaled may be faster. */ openvdb::tools::resampleToMatch(grid, *storage); + /* Ensure valid background value for level set grids, otherwise pruning will throw an exception. + */ + if (storage->background() < 0.0f) { + storage->tree().root().setBackground(0.0f, true); + } openvdb::tools::pruneLevelSet(storage->tree()); return *storage;