Poly Proxy: texture_name

texture_name
  • Returns the name of the polygon texture.  

Return Type:

  • string
  • Returns NULL if there isn't a texture.
    Sample Code

    ############################# get the polygon texture name

    # import bge
    import bge

    # get the current controller
    cont = bge.logic.getCurrentController()

    # get object that owns this controller
    obj = cont.owner
     
    # Get a list of the mesh
    meshList = obj.meshes

    # Get the first mesh on the object
    mesh = meshList[0]
     
    # get the first polygon on the mesh
    poly = mesh.getPolygon(0)

    # get the polygon texture name
    name = poly.texture_name