Commit: 122d6d67e6a0b9036be46f871765d7789921579e
Author: Jacques Lucke
Date: Fri Dec 9 11:42:10 2022 +0100
Branches: master
https://developer.blender.org/rB122d6d67e6a0b9036be46f871765d7789921579e
Fix: Points to Volume node crashes with too small radius
OpenVDB likes to crash even in release builds when volumes become too small.
To fix this I used the same function that we use in other places already to
determine if the resulting volume will be too small.
===================================================================
M source/blender/nodes/geometry/nodes/node_geo_points_to_volume.cc
===================================================================
diff --git a/source/blender/nodes/geometry/nodes/node_geo_points_to_volume.cc
b/source/blender/nodes/geometry/nodes/node_geo_points_to_volume.cc
index c6801cf15aa..8e5e84fd94a 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_points_to_volume.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_points_to_volume.cc
@@ -209,9 +209,14 @@ static void
initialize_volume_component_from_points(GeoNodeExecParams ¶ms,
}
}
+ if (positions.is_empty()) {
+ return;
+ }
+
const float max_radius = *std::max_element(radii.begin(), radii.end());
const float voxel_size = compute_voxel_size(params, positions, max_radius);
- if (voxel_size == 0.0f || positions.is_empty()) {
+ const double determinant = std::pow<double>(voxel_size, 3.0);
+ if (!BKE_volume_grid_determinant_valid(determinant)) {
return;
}
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs