Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2014-04-07 17:07:16 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-04-07 17:07:16 +0400
commit31bccec0b5b75e2dcb08e4383fc155b794858ba6 (patch)
tree254848ed38f1084236b3ccacd4f37f3a086d1f4a /add_mesh_extra_objects
parent95a9c96dc004e765a9ea6667ba51b7395b9c629c (diff)
Fix T39629: Teapot creates corrupt mesh
more of a workaround, at least stops crash.
Diffstat (limited to 'add_mesh_extra_objects')
-rw-r--r--add_mesh_extra_objects/add_mesh_teapot.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/add_mesh_extra_objects/add_mesh_teapot.py b/add_mesh_extra_objects/add_mesh_teapot.py
index ecb97275..4e5b3f8d 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.