Commit: 75381aea50d401e4fc227109e10681ea0261b82a
Author: Campbell Barton
Date:   Tue Jun 10 01:18:05 2014 +1000
https://developer.blender.org/rB75381aea50d401e4fc227109e10681ea0261b82a

Fix for slowdown converting mesh to curve with large polygons

Walk the linked list rather then doing index lookups.

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

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

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

diff --git a/source/blender/blenkernel/intern/mesh.c 
b/source/blender/blenkernel/intern/mesh.c
index f0566a7..7197d56 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;
                                }
                        }

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to