I've got a question concerning using Python in Blender's Game Engine.
Before I start I want to state that I'm trying to change the color of an object in Blender's game engine. To do this, I'm attempting to find a way to update the texture of the object (I basically want two or three states, red, (yellow), green).
What I'm doing right now is:
scene = GameLogic.getCurrentScene(); pingMeter = scene.objects['Ping Meter']; mesh = pingMeter.meshes; materials = mesh.materials; material = materials;
However, when I do
print(material.__class__.__name__) it outputs
KX_BlenderMaterial. Shouldn't I be getting
KX_PolygonMaterial if I'm running the Blender Game Engine? Is there anyway to change color or texture with
KX_BlenderMaterial because I can't find anything in the documentation. Can I get an instance of
KX_PolygonMaterial out of the code above?
...or should I just take a different approach all together?
EDIT: I'm using Blender 2.65 which uses Python 3 in case anyone is wondering.