Skip to content

Instantly share code, notes, and snippets.

Created Jun 10, 2013

What would you like to do?
def mesh_append_face( obj, bm, vertex_list, uv_list, texture_name ):
# add vertices and uvs before creating the new face
for vert in vertex_list:*vert)) ( bm.verts[i] for i in range( -len( vertex_list ), 0)) )
# add uvs to the new face
uv_layer = bm.loops.layers.uv.verify()
face = bm.faces[-1]
for i, loop in enumerate(face.loops):
loop[uv_layer].uv = uv_list[i]
# assign material
material_names = [ for m in ]
material_id = material_names.index(texture_name)
except ValueError:[texture_name])
material_id = len( - 1
face.material_index = material_id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.