[Bf-blender-cvs] [3487d13a7ea] soc-2019-adaptive-cloth: Cloth: fix edge size error

ishbosamiya noreply at git.blender.org
Fri Jun 14 22:06:11 CEST 2019


Commit: 3487d13a7eaa9bf1da04ebf7413df67282ba459f
Author: ishbosamiya
Date:   Sat Jun 15 01:33:03 2019 +0530
Branches: soc-2019-adaptive-cloth
https://developer.blender.org/rB3487d13a7eaa9bf1da04ebf7413df67282ba459f

Cloth: fix edge size error

If there are sewing edges (loose edges), those edges would not have loops, finding the UVs was dependent on the loops, now there is check to see if there is a loop.
TODO: when splitting edges that are connected to sewing edges, need to find a way to add a new sewing edge

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

M	source/blender/blenkernel/intern/cloth.c

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

diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c
index dc119a4982c..d3e9d30590c 100644
--- a/source/blender/blenkernel/intern/cloth.c
+++ b/source/blender/blenkernel/intern/cloth.c
@@ -681,6 +681,13 @@ static float cloth_remeshing_edge_size(BMesh *bm, BMEdge *edge, LinkNodePair *si
   MLoopUV *luv;
   const int cd_loop_uv_offset = CustomData_get_offset(&bm->ldata, CD_MLOOPUV);
 
+  /* find edge_size only if edge has a loop (so it has a face attached) */
+  if (!edge->l) {
+    /* TODO(Ish): Might want to mark such an edge as sewing edge, so it can be used when an edge
+     * connected to 2 sewing edges is split, new sewing edges can be added */
+    return 0.0f;
+  }
+
   l = edge->l;
   if (l->v == edge->v1) {
     if (l->next->v == edge->v2) {



More information about the Bf-blender-cvs mailing list