Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import bpy
- for mesh in bpy.data.meshes:
- changed = 0
- usedverts = set()
- for face in mesh.polygons:
- for layer, texmap in enumerate(mesh.uv_textures):
- tex = texmap.data[face.index]
- if tex.image and tex.image.name == 'construction-facemelt.tga':
- for v in face.loop_indices:
- if v not in usedverts:
- uv = mesh.uv_layers[layer].data[v].uv
- uv.y = uv.y / 2.0 + 0.5
- changed += 1
- usedverts.add(v)
- if changed > 0:
- print("Updated", changed, "UVs on", mesh.name)
Advertisement
Add Comment
Please, Sign In to add comment