So I’ve been messing around with object’s meshes and came into trouble when getting Polygon’s material.
The API says:
KX_PolygonMaterial(PyObjectPlus)
getMaterial()[TABLE="class: docutils field-list"]
[TR="class: field-odd field"]
[TH="class: field-name"]Returns:[/TH]
The polygon material
[/TR]
[TR="class: field-even field"]
[TH="class: field-name"]Return type:[/TH]
[KX_PolygonMaterial](http://www.blender.org/documentation/blender_python_api_2_69_1/bge.types.KX_PolygonMaterial.html#bge.types.KX_PolygonMaterial) or [KX_BlenderMaterial](http://www.blender.org/documentation/blender_python_api_2_69_1/bge.types.KX_BlenderMaterial.html#bge.types.KX_BlenderMaterial)
[/TR]
[/TABLE]
As you can see theres 2 return types and the question is: how do I define which return type it should return?
In my case I need KX_PolygonMaterial, but polygon.getMaterial() returns KX_BlenderMaterial