numMaterials
numMaterials
Returns the number of materials on a mesh.
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 number of the materials on the mesh
number = mesh.numMaterials
|