BGE python: get list of vertices i want to iterate through every single vertex of an object and then store them in a list.

what I have so far is:

for mesh in object.meshes:
   for m_index in range(len(mesh.materials)):
      for v_index in range(mesh.getVertexArrayLength(m_index)):

         vertex = mesh.getVertex(m_index, v_index)


now i understand that "v_index" gets me "vertex 0 through 23" of the object (its a cube), but how can i store the result in a list?

vertex_list(0,1,2,3,4...23)


thanks for any hint,

sputi
While not blender specific, it is a basic python list operation. Start by creating an empty list, then append each item.

verts = []
for mesh in object.meshes:
    for m_index in range(len(mesh.materials)):
        for v_index in range(mesh.getVertexArrayLength(m_index)):
            verts.append(mesh.getVertex(m_index, v_index))


You may also want to adjust them as you go instead of making a list.

posadjust = [0,1,2,3]
negadjust = [4,5,6,7]
for mesh in object.meshes:
    for m_index in range(len(mesh.materials)):
        for v_index in range(mesh.getVertexArrayLength(m_index)):
            if v_index in posadjust:
                vertex = mesh.getVertex(m_index, v_index)
                vertex.x += 0.2
            elif v_index in negadjust:
                vertex = mesh.getVertex(m_index, v_index)
                vertex.x -= 0.2