[Bf-blender-cvs] [09130900916] soc-2021-adaptive-cloth: adaptive_cloth: fix: Mesh: collapse_edge_triangulate(): delete node only if no other vert refers to it

ishbosamiya noreply at git.blender.org
Mon Jul 19 17:35:42 CEST 2021


Commit: 0913090091643d68a2ea3d2c99f00ccfef97e3cb
Author: ishbosamiya
Date:   Tue Jul 13 11:55:26 2021 +0530
Branches: soc-2021-adaptive-cloth
https://developer.blender.org/rB0913090091643d68a2ea3d2c99f00ccfef97e3cb

adaptive_cloth: fix: Mesh: collapse_edge_triangulate(): delete node only if no other vert refers to it

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

M	source/blender/blenkernel/BKE_cloth_remesh.hh

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

diff --git a/source/blender/blenkernel/BKE_cloth_remesh.hh b/source/blender/blenkernel/BKE_cloth_remesh.hh
index d77e91a73e6..a9244ffe926 100644
--- a/source/blender/blenkernel/BKE_cloth_remesh.hh
+++ b/source/blender/blenkernel/BKE_cloth_remesh.hh
@@ -1610,10 +1610,13 @@ template<typename END, typename EVD, typename EED, typename EFD> class Mesh {
       auto v1 = this->delete_vert(v1_index);
       deleted_verts.append(std::move(v1));
     }
-    /* delete n1 */
+    /* delete n1 if it doesn't have any `Vert`s */
     {
-      auto n1 = this->delete_node(n1_index);
-      deleted_nodes.append(std::move(n1));
+      auto n1 = this->get_checked_node(n1_index);
+      if (n1.verts.is_empty()) {
+        auto n1 = this->delete_node(n1_index);
+        deleted_nodes.append(std::move(n1));
+      }
     }
 
     return MeshDiff(std::move(added_nodes),



More information about the Bf-blender-cvs mailing list