[Bf-blender-cvs] [29e33cfff5b] master: Fix T94659: crash when deleting instances (part 2)

Jacques Lucke noreply at git.blender.org
Fri Jan 7 08:25:44 CET 2022


Commit: 29e33cfff5b6e9d2e83ae5fdb2372163fe251817
Author: Jacques Lucke
Date:   Fri Jan 7 08:21:34 2022 +0100
Branches: master
https://developer.blender.org/rB29e33cfff5b6e9d2e83ae5fdb2372163fe251817

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.

===================================================================

M	source/blender/nodes/geometry/nodes/node_geo_delete_geometry.cc

===================================================================

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));



More information about the Bf-blender-cvs mailing list