How does blender number its vertices?

Hi guys,

Please move this post to the correct forum if this has been posted in the wrong place.

I’m having a bit of trouble sorting out how blender numbers its vertices. I’m essentially manipulating vertices through python as follows:

import bge

cont = bge.logic.getCurrentController()
object = cont.owner
p = object[“prop”]
print(p)

mesh = object.meshes[0]

vertex = mesh.getVertex(1,(p))
pos=vertex.XYZ
vertex.XYZ = [pos[0],pos[1],1]

This essentially moves Vertex 1, followed by 2, 3 etc, (currently I’m using a property to help try and find the correct sequence in order). However, Vertex 1, for example, doesn’t correspond with labelled Vertex 1 I see when using plugin to visualize vertex indices.

Visual Vertex 1:


Python Vertex 1: (in the image the vertex has already moved, as per the code, to identify itself)

So as you can see there is an obvious discrepancy. How does blender actually numbers its vertices? How can I properly see this numbering system?

Thanks!

You should treat geometry element indices as opaque values and not rely on them, ever.