chiark / gitweb /
Added online stat collection, added dropdown 3D button.
[cura.git] / Cura / util / meshLoaders / obj.py
index d6b2cd7ddde0b806d9db134d3334e0c854dc9a32..e8c7dfa77a2ba6f4387393a44beacc256e79f3cb 100644 (file)
@@ -26,10 +26,16 @@ class objModel(mesh.mesh):
                self._prepareVertexCount(len(faceList) * 3)
                for f in faceList:
                        i = f[0] - 1
+                       if i < 0 or i >= len(vertexList):
+                               i = 0
                        self.addVertex(vertexList[i][0], vertexList[i][1], vertexList[i][2])
                        i = f[1] - 1
+                       if i < 0 or i >= len(vertexList):
+                               i = 0
                        self.addVertex(vertexList[i][0], vertexList[i][1], vertexList[i][2])
                        i = f[2] - 1
+                       if i < 0 or i >= len(vertexList):
+                               i = 0
                        self.addVertex(vertexList[i][0], vertexList[i][1], vertexList[i][2])
                
                self._postProcessAfterLoad()