I keep getting a keyerror and I don’t understand why, here is the code snippet
#finds the corresponding vertices for mirror
def FindCorrespVerts():
global myMesh
correspXVertsDict = {}
correspYVertsDict = {}
correspZVertsDict = {}
vertexDict = {}
for vertex in myMesh.verts:
vertexDict[vertex.co] = vertex
print vertexDict
for vertex in myMesh.verts:
mirroredXCoord = Vector([-vertex.co[0],vertex.co[1],vertex.co[2]])
try:
correspXVertsDict[vertex] = vertexDict[mirroredXCoord]
except KeyError:
pass
print correspXVertsDict
return correspXVertsDict
Any idea what I am doing wrong?
Thanks,
LetterRIp