Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2014-06-09 19:18:05 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-06-09 19:18:05 +0400
commit75381aea50d401e4fc227109e10681ea0261b82a (patch)
treed98255bf92e994508f57171fdb94c5aa4bef039c /source/blender/blenkernel
parentf1f33ba7be2d6c1c1f79c1f833543948f9b3bb79 (diff)
Fix for slowdown converting mesh to curve with large polygons
Walk the linked list rather then doing index lookups.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/intern/mesh.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c
index f0566a7f473..7197d560bcc 100644
--- a/source/blender/blenkernel/intern/mesh.c
+++ b/source/blender/blenkernel/intern/mesh.c
@@ -1531,7 +1531,7 @@ void BKE_mesh_from_nurbs(Object *ob)
}
typedef struct EdgeLink {
- Link *next, *prev;
+ struct EdgeLink *next, *prev;
void *edge;
} EdgeLink;
@@ -1610,13 +1610,11 @@ void BKE_mesh_to_curve_nurblist(DerivedMesh *dm, ListBase *nurblist, const int e
BLI_freelinkN(&edges, edges.last); totedges--;
while (ok) { /* while connected edges are found... */
+ EdgeLink *edl = edges.last;
ok = false;
- i = totedges;
- while (i) {
- EdgeLink *edl;
+ while (edl) {
+ EdgeLink *edl_prev = edl->prev;
- i -= 1;
- edl = BLI_findlink(&edges, i);
med = edl->edge;
if (med->v1 == endVert) {
@@ -1643,6 +1641,8 @@ void BKE_mesh_to_curve_nurblist(DerivedMesh *dm, ListBase *nurblist, const int e
BLI_freelinkN(&edges, edl); totedges--;
ok = true;
}
+
+ edl = edl_prev;
}
}