hallo,
i catched this script in documentation from the gamelogic, but i have problems to run it.
import GameLogic
co = GameLogic.getCurrentController()
obj = co.owner
m_i = 0
allmeshes = obj.meshes
print(allmeshes)
mesh = obj.getMesh("Cube") # There can be more than one mesh...
while mesh != None:
for mat in range(mesh.getNumMaterials()):
for v_index in range(mesh.getVertexArrayLength(mat)):
vertex = mesh.getVertex(mat, v_index)
# Do something with vertex here...
# ... eg: colour the vertex red.
vertex.colour = [1.0, 0.0, 0.0, 1.0]
m_i += 1
mesh = obj.getMesh(m_i)
i get the following error:
AttributeError: 'KX_GameObject' object has no attribute 'getMesh'
i am using 2.57b on ubuntu 64bit.
any ideas whats going wrong, are there any changes in gamelogic since updating the documentation?
best,
glow