Fix #30524: documentation example code for bge.types.KX_MeshProxy did not work,
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Mon, 12 Mar 2012 13:04:06 +0000 (13:04 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Mon, 12 Mar 2012 13:04:06 +0000 (13:04 +0000)
using fix suggested by Ryan King.

doc/python_api/rst/bge.types.rst

index 3c15362a4ec5be06f9aee58deca5212547e7f372..fda05bb6ed5bcff1d341a381edb5a246c9ec2f24 100644 (file)
@@ -1806,9 +1806,9 @@ Game Types (bge.types)
       object = cont.owner
 
       for mesh in object.meshes:
-         for material in mesh.materials:
+         for m_index in range(len(mesh.materials)):
             for v_index in range(mesh.getVertexArrayLength(mat)):
-               vertex = mesh.getVertex(mat, v_index)
+               vertex = mesh.getVertex(m_index, v_index)
                # Do something with vertex here...
                # ... eg: colour the vertex red.
                vertex.colour = [1.0, 0.0, 0.0, 1.0]