fix [#27707] Script error for UVs->Copy Mirrored UV coords
authorCampbell Barton <ideasman42@gmail.com>
Tue, 21 Jun 2011 02:16:22 +0000 (02:16 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 21 Jun 2011 02:16:22 +0000 (02:16 +0000)
release/scripts/startup/bl_operators/mesh.py

index 89802d7ba5cf759dfe98109b00b43dfd94209ed5..996b38ae5717592ca2009c2ea3f14f0024812295 100644 (file)
@@ -152,7 +152,6 @@ class MeshMirrorUV(bpy.types.Operator):
                 if j is not None:
                     fmap[i] = j
 
-        done = [False] * len(faces)
         for i, j in fmap.items():
 
             if not fuvsel[i] or not fuvsel[j]:
@@ -170,10 +169,10 @@ class MeshMirrorUV(bpy.types.Operator):
             v1 = faces[j].vertices[:]
             v2 = [vmap[k] for k in faces[i].vertices[:]]
 
-            for k in range(len(uv1)):
-                k_map = v1.index(v2[k])
-                uv1[k].x = - (uv2[k_map].x - 0.5) + 0.5
-                uv1[k].y = uv2[k_map].y
+            if len(v1) == len(v2):
+                for k in range(len(v1)):
+                    k_map = v1.index(v2[k])
+                    uv1[k].xy = - (uv2[k_map].x - 0.5) + 0.5, uv2[k_map].y
 
         if is_editmode:
             bpy.ops.object.mode_set(mode='EDIT', toggle=False)