Slicing logic now index-aware, correctly processes scenes with vertex reuse

This commit is contained in:
Seva Alekseyev 2016-08-11 11:17:48 -04:00 committed by Ghostkeeper
parent 8190b9875e
commit 5cb9f97986

View file

@ -148,7 +148,12 @@ class StartSliceJob(Job):
obj = group_message.addRepeatedMessage("objects")
obj.id = id(object)
verts = numpy.array(mesh_data.getVertices())
verts = mesh_data.getVertices()
indices = mesh_data.getIndices()
if not indices is None:
verts = numpy.array([verts[vert_index] for face in indices for vert_index in face])
else:
verts = numpy.array(verts)
# Convert from Y up axes to Z up axes. Equals a 90 degree rotation.
verts[:, [1, 2]] = verts[:, [2, 1]]