[Bf-blender-cvs] [e24fca7f1dd] soc-2019-adaptive-cloth: Cloth: initial steps towards edge label support

ishbosamiya noreply at git.blender.org
Wed Jul 31 11:34:53 CEST 2019


Commit: e24fca7f1ddf729719403e56f094325ba43eb642
Author: ishbosamiya
Date:   Tue Jul 30 01:02:14 2019 +0530
Branches: soc-2019-adaptive-cloth
https://developer.blender.org/rBe24fca7f1ddf729719403e56f094325ba43eb642

Cloth: initial steps towards edge label support

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

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 8e1b1da2d33..99ecc9bb280 100644
--- a/source/blender/blenkernel/intern/cloth_remeshing.cpp
+++ b/source/blender/blenkernel/intern/cloth_remeshing.cpp
@@ -174,9 +174,9 @@ static void cloth_remeshing_init_bmesh(Object *ob,
     }
     BMEdge *e;
     BMIter eiter;
-    /* BM_ITER_MESH (e, &eiter, clmd->clothObject->bm, BM_EDGES_OF_MESH) { */
-    /*   BM_elem_flag_enable(e, BM_ELEM_TAG); */
-    /* } */
+    BM_ITER_MESH (e, &eiter, clmd->clothObject->bm_prev, BM_EDGES_OF_MESH) {
+      BM_elem_flag_enable(e, BM_ELEM_TAG);
+    }
 
     BM_mesh_normals_update(clmd->clothObject->bm_prev);
 
@@ -472,9 +472,9 @@ static vector<BMEdge *> cloth_remeshing_find_edges_to_flip(BMesh *bm,
     if (cloth_remeshing_edge_on_seam_or_boundary_test(bm, e)) {
       continue;
     }
-    /* if (cloth_remeshing_edge_label_test(e)) { */
-    /*   continue; */
-    /* } */
+    if (cloth_remeshing_edge_label_test(e)) {
+      continue;
+    }
     if (!cloth_remeshing_should_flip(bm, e, cvm)) {
       continue;
     }
@@ -1338,9 +1338,9 @@ static BMVert *cloth_remeshing_try_edge_collapse(ClothModifierData *clmd,
     return NULL;
   }
 
-  /* if (cloth_remeshing_has_labeled_edges(v1) && !cloth_remeshing_edge_label_test(e)) { */
-  /*   return NULL; */
-  /* } */
+  if (cloth_remeshing_has_labeled_edges(v1) && !cloth_remeshing_edge_label_test(e)) {
+    return NULL;
+  }
 
   if (!cloth_remeshing_can_collapse_edge(clmd, bm, e, which, cvm)) {
     return NULL;
@@ -2255,7 +2255,7 @@ Mesh *cloth_remeshing_step(Depsgraph *depsgraph, Object *ob, ClothModifierData *
   ClothVertMap cvm;
   cloth_remeshing_init_bmesh(ob, clmd, mesh, cvm);
 
-  if (true) {
+  if (false) {
     cloth_remeshing_static(clmd, cvm);
   }
   else {
@@ -2279,3 +2279,6 @@ Mesh *cloth_remeshing_step(Depsgraph *depsgraph, Object *ob, ClothModifierData *
 }
 
 /* TODO(Ish): update the BM_ELEM_TAG on the edges */
+/* TODO(Ish): the mesh randomly flips again, might be due to bringing
+ * back bm_prev, need to look into this heavily later, noticed again
+ * at commit 5035e4cb34cc2d60ec49c5009599af6eab864313 */



More information about the Bf-blender-cvs mailing list