Oh, I never realized that ent_getmesh is specifically intended (among others) to be used for level blocks:
http://www.conitec.net/beta/ent_mesh.htm

Code:
///////////////////////////////
#include <acknex.h>
#include <default.c>
#include <windows.h>
#include <d3d9.h>
///////////////////////////////

HRESULT WINAPI 
D3DXSaveMeshToXA(
char* pFilename,
LPD3DXMESH pMesh,
void* pAdjacency,
void* pMaterials,
void* pEffectInstances, 
DWORD NumMaterials,
DWORD Format
);

#define D3DXF_FILEFORMAT_BINARY 0
#define D3DXF_FILEFORMAT_TEXT 1
#define D3DXF_FILEFORMAT_COMPRESSED 2

char *cTextureFile = "someFile.tga";

D3DXMATERIAL d3dmaterial[2];

void wmbSaveAllBlocksToFiles()
{
	d3dmaterial[0].pTextureFilename = cTextureFile;
	d3dmaterial[1].pTextureFilename = cTextureFile;
	int blockNum = 0;
	while(1)
	{
		LPD3DXMESH mesh = ent_getmesh(NULL,blockNum ,0);
		if(!mesh) break;
		
		STRING *str = str_printf(NULL,"export\block%d.x",blockNum);
		D3DXSaveMeshToXA(str->chars, mesh, NULL, d3dmaterial, NULL, 2, D3DXF_FILEFORMAT_BINARY);
		
		blockNum++;
	}
}

void main()
{
	fps_max = 60;
	video_mode = 10;
	level_load("deathMountain.wmb");
	wait(1);
	wmbSaveAllBlocksToFiles();
}



Just gave it a quick shot, almost worked immediately. You need to supply a material so it exports the UVs as well. Apparently sadly though, only the first UV map is saved. Might be wrong though. (The model shows up as black in MED because I did not fully set up the d3dmaterial.)

MED has some sort of skin mapping import and export. Maybe you could look at it, then write a basic code that outputs the 2nd UV map in the correct format (to a text file) and import in MED.
Could work but might not be that easy.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends