diff options
author | Jacques Lucke <jacques@blender.org> | 2022-01-07 10:21:34 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2022-01-07 10:21:34 +0300 |
commit | 29e33cfff5b6e9d2e83ae5fdb2372163fe251817 (patch) | |
tree | 52475c35ddd3477386b486f85e6e65ee573e6278 /source/blender | |
parent | 6c906b7c219f3fdf9489856de03d0124e854c982 (diff) |
Fix T94659: crash when deleting instances (part 2)
This was missing from rB3e92b4ed2408eacd126c0.
Before only the Separate Geometry node was fixed, because that
node was used in the file from the bug report. The same issue
existed in the Delete Geometry node as well though.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/nodes/geometry/nodes/node_geo_delete_geometry.cc | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/source/blender/nodes/geometry/nodes/node_geo_delete_geometry.cc b/source/blender/nodes/geometry/nodes/node_geo_delete_geometry.cc index 5ea8034c437..b3325844a5c 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_delete_geometry.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_delete_geometry.cc @@ -1354,16 +1354,16 @@ static void node_geo_exec(GeoNodeExecParams params) const AttributeDomain domain = static_cast<AttributeDomain>(storage.domain); const GeometryNodeDeleteGeometryMode mode = (GeometryNodeDeleteGeometryMode)storage.mode; - bool all_is_error = false; - geometry_set.modify_geometry_sets([&](GeometrySet &geometry_set) { - bool this_is_error = false; - /* Invert here because we want to keep the things not in the selection. */ - separate_geometry(geometry_set, domain, mode, selection_field, true, this_is_error); - all_is_error &= this_is_error; - }); - if (all_is_error) { - /* Only show this if none of the instances/components actually changed. */ - params.error_message_add(NodeWarningType::Info, TIP_("No geometry with given domain")); + if (domain == ATTR_DOMAIN_INSTANCE) { + bool is_error; + separate_geometry(geometry_set, domain, mode, selection_field, true, is_error); + } + else { + geometry_set.modify_geometry_sets([&](GeometrySet &geometry_set) { + bool is_error; + /* Invert here because we want to keep the things not in the selection. */ + separate_geometry(geometry_set, domain, mode, selection_field, true, is_error); + }); } params.set_output("Geometry", std::move(geometry_set)); |