Fix #108537: Incorrect early return in delete geometry node #108540
|
@ -276,7 +276,10 @@ std::optional<Mesh *> mesh_copy_selection(
|
|||
if (vert_mask.is_empty()) {
|
||||
return nullptr;
|
||||
mod_moder marked this conversation as resolved
Outdated
|
||||
}
|
||||
if (vert_mask.size() == src_mesh.totvert) {
|
||||
const bool same_verts = vert_mask.size() == src_mesh.totvert;
|
||||
mod_moder marked this conversation as resolved
Outdated
Hans Goudey
commented
`vertices` -> `verts`
Iliya Katushenock
commented
`polygons` -> `polys` too?
Hans Goudey
commented
Ah right, yes. Ah right, yes.
|
||||
const bool same_edges = edge_mask.size() == src_mesh.totedge;
|
||||
const bool same_polys = poly_mask.size() == src_mesh.totpoly;
|
||||
if (same_verts && same_edges && same_polys) {
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
|
@ -408,6 +411,12 @@ std::optional<Mesh *> mesh_copy_selection_keep_verts(
|
|||
break;
|
||||
}
|
||||
|
||||
const bool same_edges = edge_mask.size() == src_mesh.totedge;
|
||||
const bool same_polys = poly_mask.size() == src_mesh.totpoly;
|
||||
if (same_edges && same_polys) {
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
Mesh *dst_mesh = create_mesh_no_attributes(
|
||||
src_mesh, src_mesh.totvert, edge_mask.size(), poly_mask.size(), 0);
|
||||
bke::MutableAttributeAccessor dst_attributes = dst_mesh->attributes_for_write();
|
||||
|
@ -488,6 +497,11 @@ std::optional<Mesh *> mesh_copy_selection_keep_edges(
|
|||
break;
|
||||
}
|
||||
|
||||
const bool same_polys = poly_mask.size() == src_mesh.totpoly;
|
||||
if (same_polys) {
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
Mesh *dst_mesh = create_mesh_no_attributes(
|
||||
src_mesh, src_mesh.totvert, src_mesh.totedge, poly_mask.size(), 0);
|
||||
bke::MutableAttributeAccessor dst_attributes = dst_mesh->attributes_for_write();
|
||||
|
|
Loading…
Reference in New Issue
I don't think this part is necessary. IMO
nullptr
is clear enough fromstd::nullopt
that the intent is clear as well.