forked from bartvdbraak/blender
uv mirror poll function wasnt checking UV's were available on the mesh.
This commit is contained in:
parent
cf05777bc0
commit
590682bac1
@ -81,8 +81,8 @@ class MeshMirrorUV(bpy.types.Operator):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
ob = context.active_object
|
obj = context.active_object
|
||||||
return (ob and ob.type == 'MESH')
|
return (obj and obj.type == 'MESH' and obj.data.uv_textures.active)
|
||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
DIR = (self.direction == 'NEGATIVE')
|
DIR = (self.direction == 'NEGATIVE')
|
||||||
@ -120,12 +120,7 @@ class MeshMirrorUV(bpy.types.Operator):
|
|||||||
if j is not None:
|
if j is not None:
|
||||||
vmap[i] = j
|
vmap[i] = j
|
||||||
|
|
||||||
active_uv_layer = None
|
active_uv_layer = mesh.uv_textures.active.data
|
||||||
for lay in mesh.uv_textures:
|
|
||||||
if lay.active:
|
|
||||||
active_uv_layer = lay.data
|
|
||||||
break
|
|
||||||
|
|
||||||
fuvs = [(uv.uv1, uv.uv2, uv.uv3, uv.uv4) for uv in active_uv_layer]
|
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]
|
fuvs_cpy = [(uv[0].copy(), uv[1].copy(), uv[2].copy(), uv[3].copy()) for uv in fuvs]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user