Cleanup: Simplify mesh to legacy curve logic #105870

Merged
Hans Goudey merged 2 commits from bonj/blender:cleanup/convert-mesh-to-curve into main 2023-03-18 03:49:36 +01:00
1 changed files with 1 additions and 9 deletions

View File

@ -472,8 +472,6 @@ void BKE_mesh_to_curve_nurblist(const Mesh *me, ListBase *nurblist, const int ed
const Span<MPoly> polys = me->polys(); const Span<MPoly> polys = me->polys();
const Span<MLoop> loops = me->loops(); const Span<MLoop> loops = me->loops();
int totedges = 0;
/* only to detect edge polylines */ /* only to detect edge polylines */
int *edge_users; int *edge_users;
@ -497,7 +495,6 @@ void BKE_mesh_to_curve_nurblist(const Mesh *me, ListBase *nurblist, const int ed
edl->edge = &mesh_edges[i]; edl->edge = &mesh_edges[i];
BLI_addtail(&edges, edl); BLI_addtail(&edges, edl);
totedges++;
} }
} }
MEM_freeN(edge_users); MEM_freeN(edge_users);
@ -519,7 +516,6 @@ void BKE_mesh_to_curve_nurblist(const Mesh *me, ListBase *nurblist, const int ed
appendPolyLineVert(&polyline, endVert); appendPolyLineVert(&polyline, endVert);
totpoly++; totpoly++;
BLI_freelinkN(&edges, edges.last); BLI_freelinkN(&edges, edges.last);
totedges--;
while (ok) { /* while connected edges are found... */ while (ok) { /* while connected edges are found... */
EdgeLink *edl = (EdgeLink *)edges.last; EdgeLink *edl = (EdgeLink *)edges.last;
@ -531,10 +527,9 @@ void BKE_mesh_to_curve_nurblist(const Mesh *me, ListBase *nurblist, const int ed
if (edge->v1 == endVert) { if (edge->v1 == endVert) {
endVert = edge->v2; endVert = edge->v2;
appendPolyLineVert(&polyline, edge->v2); appendPolyLineVert(&polyline, endVert);
totpoly++; totpoly++;
BLI_freelinkN(&edges, edl); BLI_freelinkN(&edges, edl);
totedges--;
ok = true; ok = true;
} }
else if (edge->v2 == endVert) { else if (edge->v2 == endVert) {
@ -542,7 +537,6 @@ void BKE_mesh_to_curve_nurblist(const Mesh *me, ListBase *nurblist, const int ed
appendPolyLineVert(&polyline, endVert); appendPolyLineVert(&polyline, endVert);
totpoly++; totpoly++;
BLI_freelinkN(&edges, edl); BLI_freelinkN(&edges, edl);
totedges--;
ok = true; ok = true;
} }
else if (edge->v1 == startVert) { else if (edge->v1 == startVert) {
@ -550,7 +544,6 @@ void BKE_mesh_to_curve_nurblist(const Mesh *me, ListBase *nurblist, const int ed
prependPolyLineVert(&polyline, startVert); prependPolyLineVert(&polyline, startVert);
totpoly++; totpoly++;
BLI_freelinkN(&edges, edl); BLI_freelinkN(&edges, edl);
totedges--;
ok = true; ok = true;
} }
else if (edge->v2 == startVert) { else if (edge->v2 == startVert) {
@ -558,7 +551,6 @@ void BKE_mesh_to_curve_nurblist(const Mesh *me, ListBase *nurblist, const int ed
prependPolyLineVert(&polyline, startVert); prependPolyLineVert(&polyline, startVert);
totpoly++; totpoly++;
BLI_freelinkN(&edges, edl); BLI_freelinkN(&edges, edl);
totedges--;
ok = true; ok = true;
} }