[Bf-extensions-cvs] [31bccec] master: Fix T39629: Teapot creates corrupt mesh
Campbell Barton
noreply at git.blender.org
Mon Apr 7 15:08:44 CEST 2014
Commit: 31bccec0b5b75e2dcb08e4383fc155b794858ba6
Author: Campbell Barton
Date: Mon Apr 7 23:07:16 2014 +1000
https://developer.blender.org/rBA31bccec0b5b75e2dcb08e4383fc155b794858ba6
Fix T39629: Teapot creates corrupt mesh
more of a workaround, at least stops crash.
===================================================================
M add_mesh_extra_objects/add_mesh_teapot.py
===================================================================
diff --git a/add_mesh_extra_objects/add_mesh_teapot.py b/add_mesh_extra_objects/add_mesh_teapot.py
index ecb9727..4e5b3f8 100644
--- a/add_mesh_extra_objects/add_mesh_teapot.py
+++ b/add_mesh_extra_objects/add_mesh_teapot.py
@@ -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.
More information about the Bf-extensions-cvs
mailing list