Created
January 13, 2016 19:30
-
-
Save zeffii/cd72406d06888361fdf4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
obj = bpy.context.active_object | |
# Store all UV vertex locations | |
uv_coords = [] | |
for loop in obj.data.loops: | |
uv_loc = obj.data.uv_layers.active.data[loop.index].uv | |
uv_coords.append(tuple(map(lambda x: round(x,3), uv_loc[:]))) | |
# Keep only the unique ones and count them | |
print("object {0} has {1} UV vertices".format(obj.name, len(set(uv_coords)))) | |
dupes = len(set(uv_coords)) - len(obj.data.vertices) | |
print("the number of duplicate verts is {0}:".format(dupes)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment