Do anyone know how to get the material name of an object in BGE through python??

Do anyone know how to get the material name of an object in BGE through python??

Ok there’s a caveat with the bge materialID parameter from the bge module but I have found this for the owner passed to the function chosen with the python module in the controller from the logic editor you get the controller as the only argument. so…def function(cont): for i in range(len(cont.meshes)): for amat in cont.meshes[i].materials: print(str(dir(amat)));or [print(str(a.materials)) for a in bge.logic.getCurrentController().meshes]for the python script controller but lookup my threaded command line bge module to really explore how to use the blender game engine dynamically…