Fix #147680: Crash when voxel size is too small

These grid creation functions can return a grid without data when
certain parameters are invalid. The "set_output" function of the
geometry node execution parameters asserts that the data is
not null, so I assume this is invalid and causes crashes later on.

Pull Request: https://projects.blender.org/blender/blender/pulls/147741
This commit is contained in:
Hans Goudey
2025-10-09 19:11:50 +02:00
committed by Hans Goudey
parent 8a98c6992f
commit acbd057680
2 changed files with 8 additions and 0 deletions

View File

@@ -50,6 +50,10 @@ static void node_geo_exec(GeoNodeExecParams params)
params.extract_input<float>("Voxel Size"),
params.extract_input<float>("Gradient Width"),
params.extract_input<float>("Density"));
if (!grid) {
params.set_default_remaining_outputs();
return;
}
params.set_output("Density Grid", std::move(grid));
#else
node_geo_exec_with_missing_openvdb(params);

View File

@@ -45,6 +45,10 @@ static void node_geo_exec(GeoNodeExecParams params)
mesh->corner_tris(),
params.extract_input<float>("Voxel Size"),
std::max(1, params.extract_input<int>("Band Width")));
if (!grid) {
params.set_default_remaining_outputs();
return;
}
params.set_output("SDF Grid", std::move(grid));
#else
node_geo_exec_with_missing_openvdb(params);