Get Map Name (Texture path) with .NET(c#)

Get Map Name (Texture path) with .NET(c#)

This function return the diffuse map path.Set GetSubTexmap() function of param which you want to get map.

public string GetMapName(INode node)
{
	IMtl mtl = node.Mtl;
	if (mtl != null)
	{
		//Diffuse map channel Number is 0 
		//Write to channel number which you want to get
		ITexmap texMap = mtl.GetSubTexmap(0);
		if (texMap != null)
		{
			string mapName = ((BitmapTex)texMap.GetParamBlock(0).Owner).MapName;
			return mapName;
		}
	}

	return string.Empty;
}