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>2011-07-01 17:25:00 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-07-01 17:25:00 +0400
commit590682bac1b36fe0e7dbfae532aed265f8df5052 (patch)
treef4aafe5ae90af0a16856092974e68a5b5a16284e /release/scripts/startup/bl_operators/mesh.py
parentcf05777bc0bc3f2c6b4382a9baf1d035c6f3b8b9 (diff)
uv mirror poll function wasnt checking UV's were available on the mesh.
Diffstat (limited to 'release/scripts/startup/bl_operators/mesh.py')
-rw-r--r--release/scripts/startup/bl_operators/mesh.py11
1 files changed, 3 insertions, 8 deletions
diff --git a/release/scripts/startup/bl_operators/mesh.py b/release/scripts/startup/bl_operators/mesh.py
index 996b38ae571..8dca30e54df 100644
--- a/release/scripts/startup/bl_operators/mesh.py
+++ b/release/scripts/startup/bl_operators/mesh.py
@@ -81,8 +81,8 @@ class MeshMirrorUV(bpy.types.Operator):
@classmethod
def poll(cls, context):
- ob = context.active_object
- return (ob and ob.type == 'MESH')
+ obj = context.active_object
+ return (obj and obj.type == 'MESH' and obj.data.uv_textures.active)
def execute(self, context):
DIR = (self.direction == 'NEGATIVE')
@@ -120,12 +120,7 @@ class MeshMirrorUV(bpy.types.Operator):
if j is not None:
vmap[i] = j
- active_uv_layer = None
- for lay in mesh.uv_textures:
- if lay.active:
- active_uv_layer = lay.data
- break
-
+ active_uv_layer = mesh.uv_textures.active.data
fuvs = [(uv.uv1, uv.uv2, uv.uv3, uv.uv4) for uv in active_uv_layer]
fuvs_cpy = [(uv[0].copy(), uv[1].copy(), uv[2].copy(), uv[3].copy()) for uv in fuvs]