Vertex Coloring After Parenting in BGE I am trying to use a python script during runtime of bge to vertex color a mesh. The idea is to click the mouse and vertex color a mesh (the color is not uniform so I can't use object color). A simple version of the code is below and can be illustrated on the standard cube. Put in a logic brick for a mouse left button click and call it "click" along with a python controller running to this script.

cont=bge.logic.getCurrentController()
own=cont.owner
mesh=own.meshes[0]
click=cont.sensors["click"]
if click.positive:
    vertex=mesh.getVertex(0,1)
    vertex.color=[1,0,0,1]


This setup will color one vertex red. However when I parent the object to an armature (single bone) the code fails to do anything to the mesh.

If anyone can tell me where I am wrong or what I can do to achieve the end result in another way please let me know.
cont=bge.logic.getCurrentController()
own=cont.owner
mesh=own.meshes[0]
click=cont.sensors["click"]
if click.positive:
    vertex=mesh.getVertex(0,1)
    vertex.color=[1,0,0,1]



This code has no relation to a parent of the (controller owning) object. So this should never be an issue.

I can only guess you execute this code at the armature. An armature has no mesh and will fail when you try to access it (line 3). 

Hint: When using code you should always have a console window open to see any error messages. If you already have ... please post error messages together with your question.