Advertisement
zergon321

python_geom_unused

May 21st, 2024
620
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.63 KB | Source Code | 0 0
  1. def mesh_uv_vertices_correspondance_single(object, uv_vertices):
  2.     mesh_uv = {}
  3.  
  4.     for uv_vertex in uv_vertices:
  5.         mesh_vertex_index = object.data.loops[uv_vertex[0]].vertex_index
  6.         mesh_uv[mesh_vertex_index] = uv_vertex
  7.    
  8.     return mesh_uv
  9.  
  10. def mesh_uv_vertices_correspondance_multiple(object, uv_vertices):
  11.     mesh_uvs = {}
  12.  
  13.     for uv_vertex in uv_vertices:
  14.         vertex_index = object.data.loops[uv_vertex[0]].vertex_index
  15.  
  16.         if vertex_index in mesh_uvs:
  17.             mesh_uvs[vertex_index].append(uv_vertex)
  18.         else:
  19.             mesh_uvs[vertex_index] = [uv_vertex]
  20.    
  21.     return mesh_uvs
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement