Move ensure_lookup_table outside the loop
authorCampbell Barton <ideasman42@gmail.com>
Mon, 22 Jun 2015 08:46:08 +0000 (18:46 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 22 Jun 2015 08:46:08 +0000 (18:46 +1000)
object_creaprim.py

index 513f2c1..04379dc 100644 (file)
@@ -307,10 +307,10 @@ def do_creaprim(self, mesh, objname, addondir):
                        posn2 += 1
                strlist.append(")")
        strlist.append("]\n")
+       strlist.append("                bm.verts.ensure_lookup_table()\n")
        strlist.append("                for verts in facelist:\n")
        strlist.append("                        vlist = []\n")
        strlist.append("                        for idx in verts:\n")
-       strlist.append("                                bm.verts.ensure_lookup_table()\n")
        strlist.append("                                vlist.append(bm.verts[idxlist[idx]])\n")
        strlist.append("                        try:\n")
        strlist.append("                                bm.faces.new(vlist)\n")