Fix T94852: Geometry Proximity crash when unsuccessful

Before rB644e6c7a3e99ae1d43ed, `fill` was used in the error
cases, but now `fill_indices` is used, which doesn't work when
the span is empty (when only one output is used). The fix is just
to check for that case.
This commit is contained in:
Hans Goudey 2022-01-14 16:10:38 -06:00
parent 2a095d8bfe
commit 6e926e9b56
Notes: blender-bot 2023-02-14 05:51:15 +01:00
Referenced by issue #94852, Crash with Geometry Proximity node if input is points
1 changed files with 6 additions and 2 deletions

View File

@ -191,8 +191,12 @@ class ProximityFunction : public fn::MultiFunction {
}
if (!success) {
positions.fill_indices(mask, float3(0));
distances.fill_indices(mask, 0.0f);
if (!positions.is_empty()) {
positions.fill_indices(mask, float3(0));
}
if (!distances.is_empty()) {
distances.fill_indices(mask, 0.0f);
}
return;
}