[Bf-blender-cvs] [3a5c9a0e6cf] soc-2019-adaptive-cloth: Cloth: flags support for new vertices

ishbosamiya noreply at git.blender.org
Tue Jul 16 21:01:22 CEST 2019


Commit: 3a5c9a0e6cf8d634c978160dc72afb04b989b97f
Author: ishbosamiya
Date:   Sun Jul 14 22:59:40 2019 +0530
Branches: soc-2019-adaptive-cloth
https://developer.blender.org/rB3a5c9a0e6cf8d634c978160dc72afb04b989b97f

Cloth: flags support for new vertices

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

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 57522e1eef1..cc8fea9da07 100644
--- a/source/blender/blenkernel/intern/cloth_remeshing.cpp
+++ b/source/blender/blenkernel/intern/cloth_remeshing.cpp
@@ -151,7 +151,15 @@ static void cloth_remeshing_init_bmesh(Object *ob, ClothModifierData *clmd, Mesh
 static ClothVertex cloth_remeshing_mean_cloth_vert(ClothVertex *v1, ClothVertex *v2)
 {
   ClothVertex new_vert;
-  /* TODO(Ish): flags */
+
+  new_vert.flags = 0;
+  if ((v1->flags & CLOTH_VERT_FLAG_PINNED) && (v2->flags & CLOTH_VERT_FLAG_PINNED)) {
+    new_vert.flags |= CLOTH_VERT_FLAG_PINNED;
+  }
+  if ((v1->flags & CLOTH_VERT_FLAG_NOSELFCOLL) && (v2->flags & CLOTH_VERT_FLAG_NOSELFCOLL)) {
+    new_vert.flags |= CLOTH_VERT_FLAG_NOSELFCOLL;
+  }
+
   add_v3_v3v3(new_vert.v, v1->v, v2->v);
   mul_v3_fl(new_vert.v, 0.5f);



More information about the Bf-blender-cvs mailing list