title: Getting an instance of KX_PolygonMaterial in Blender
body: <p>I've got a question concerning using Python in Blender's Game Engine.</p>
  
  <p>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).</p>
  
  <p>What I'm doing right now is:</p>
  
  <pre><code>scene = GameLogic.getCurrentScene();    
  pingMeter = scene.objects['Ping Meter'];
  mesh = pingMeter.meshes;
  materials = mesh[0].materials;
  material = materials[0];
  </code></pre>
  
  <p>However, when I do <code>print(material.__class__.__name__)</code> it outputs <code>KX_BlenderMaterial</code>.  Shouldn't I be getting <code>KX_PolygonMaterial</code> if I'm running the Blender Game Engine?  Is there anyway to change color or texture with <code>KX_BlenderMaterial</code> because I can't find anything in the documentation.  Can I get an instance of <code>KX_PolygonMaterial</code> out of the code above?</p>
  
  <p>...or should I just take a different approach all together?</p>
  
  <p>Thanks!</p>
  
  <p><strong>EDIT</strong>: I'm using Blender 2.65 which uses Python 3 in case anyone is wondering.</p>