[Bf-blender-cvs] [c80184bdea4] soc-2019-adaptive-cloth: Cloth: update_active_faces ensures no duplication of faces

ishbosamiya noreply at git.blender.org
Fri Jul 12 19:50:55 CEST 2019


Commit: c80184bdea4ab37ff00377b855e14594237fb108
Author: ishbosamiya
Date:   Fri Jul 12 12:24:54 2019 +0530
Branches: soc-2019-adaptive-cloth
https://developer.blender.org/rBc80184bdea4ab37ff00377b855e14594237fb108

Cloth: update_active_faces ensures no duplication of faces

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

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 a48c41f452a..8f3f9f21120 100644
--- a/source/blender/blenkernel/intern/cloth_remeshing.cpp
+++ b/source/blender/blenkernel/intern/cloth_remeshing.cpp
@@ -1110,7 +1110,17 @@ static void cloth_remeshing_update_active_faces(vector<BMFace *> &active_faces,
   /* remove the faces from active_faces that have been removed from
    * bmesh */
   for (int i = 0; i < active_faces.size(); i++) {
+    bool already_exists = false;
     f = active_faces[i];
+    for (int j = 0; j < new_active_faces.size(); j++) {
+      if (f == new_active_faces[j]) {
+        already_exists = true;
+        break;
+      }
+    }
+    if (already_exists) {
+      break;
+    }
     BM_ITER_MESH (f2, &fiter, bm, BM_FACES_OF_MESH) {
       if (f == f2) {
         new_active_faces.push_back(f);
@@ -1138,7 +1148,17 @@ static void cloth_remeshing_update_active_faces(vector<BMFace *> &active_faces,
   /* remove the faces from active_faces that have been removed from
    * bmesh */
   for (int i = 0; i < active_faces.size(); i++) {
+    bool already_exists = false;
     f = active_faces[i];
+    for (int j = 0; j < new_active_faces.size(); j++) {
+      if (f == new_active_faces[j]) {
+        already_exists = true;
+        break;
+      }
+    }
+    if (already_exists) {
+      break;
+    }
     BM_ITER_MESH (f2, &fiter, bm, BM_FACES_OF_MESH) {
       if (f == f2) {
         new_active_faces.push_back(f);



More information about the Bf-blender-cvs mailing list