Fix T39629: Teapot creates corrupt mesh

more of a workaround, at least stops crash.
This commit is contained in:
Campbell Barton 2014-04-07 23:07:16 +10:00
parent 95a9c96dc0
commit 31bccec0b5
Notes: blender-bot 2023-02-14 10:50:46 +01:00
Referenced by issue blender/blender#39629, Teapot creates corrupt mesh
1 changed files with 15 additions and 0 deletions

View File

@ -86,7 +86,22 @@ if __name__ == "__main__":
register()
def create_mesh_face_hack(faces):
# FIXME, faces with duplicate vertices shouldn't be created in the first place.
faces_copy = []
for f in faces:
f_copy = []
for i in f:
if i not in f_copy:
f_copy.append(i)
faces_copy.append(f_copy)
faces[:] = faces_copy
def create_mesh_object(context, verts, edges, faces, name):
create_mesh_face_hack(faces)
# Create new mesh
mesh = bpy.data.meshes.new(name)
# Make a mesh from a list of verts/edges/faces.