error in GE python api docs

Blender documentation projects, tutorials, translation, learning & teaching Blender

Moderators: jesterKing, stiv

Post Reply
Sutabi
Posts: 53
Joined: Fri Oct 18, 2002 1:35 am
Location: Oceanside, California
Contact:

error in GE python api docs

Post by Sutabi » Thu Apr 07, 2005 11:43 am

Code: Select all

       import GameLogic
       
       co = GameLogic.getcurrentController()
       obj = co.getOwner()
       
       m_i = 0
       mesh = obj.getMesh(m_i) # 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)
the lines:
"co = GameLogic.getcurrentController()" needs to be
"co = GameLogic.getCurrentController()"

Post Reply