getMaterialIndex
getMaterialIndex()
Returns the material index of the polygon.
Return Type: integer
Sample
Code
# get controller
controller = GameLogic.getCurrentController()
# get object the controller is attached to
obj = controller.owner
# get the 1st mesh
mesh = obj.meshes[0]
# get the first polygon on the mesh
poly = mesh.getPolygon(0)
# get the polygon material index
polyMatIndex = poly.getMaterialIndex()
|