[Bf-blender-cvs] [4edf29ba38d] soc-2019-adaptive-cloth: Cloth: fix bug while removing vertex from cvm

ishbosamiya noreply at git.blender.org
Tue Aug 6 20:32:55 CEST 2019


Commit: 4edf29ba38d112b2d54c67b75503d22917f9f790
Author: ishbosamiya
Date:   Tue Aug 6 17:48:31 2019 +0530
Branches: soc-2019-adaptive-cloth
https://developer.blender.org/rB4edf29ba38d112b2d54c67b75503d22917f9f790

Cloth: fix bug while removing vertex from cvm

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

M	source/blender/blenkernel/intern/cloth_remeshing.cpp

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

diff --git a/source/blender/blenkernel/intern/cloth_remeshing.cpp b/source/blender/blenkernel/intern/cloth_remeshing.cpp
index 0a2eb944eb6..e72044083ec 100644
--- a/source/blender/blenkernel/intern/cloth_remeshing.cpp
+++ b/source/blender/blenkernel/intern/cloth_remeshing.cpp
@@ -1392,10 +1392,13 @@ static bool cloth_remeshing_vert_on_seam_test(BMesh *bm, BMVert *v, const int cd
 static BMVert *cloth_remeshing_collapse_edge(BMesh *bm, BMEdge *e, int which, ClothVertMap &cvm)
 {
   BMVert *v1 = cloth_remeshing_edge_vert(e, which);
-  BMVert v = *v1;
+  /* Need to store the value of vertex v1 which will be killed */
+  BMVert *v = v1;
   BMVert *v2 = BM_edge_collapse(bm, e, v1, true, true);
 
-  cloth_remeshing_remove_vertex_from_cloth(&v, cvm);
+  if (v2) {
+    cloth_remeshing_remove_vertex_from_cloth(v, cvm);
+  }
 #if COLLAPSE_EDGES_DEBUG
   printf("killed %f %f %f into %f %f %f\n",
          v.co[0],



More information about the Bf-blender-cvs mailing list