it's not a finished script:
//edit:
Update to v1.11, uv working, some bugfix
Code: Select all
//--------------------------------------
//--- 010 Editor v3.2.1 Binary Template
//
// File: Diablo III *.app
// Author: Falo
// Revision: 1.11
//--------------------------------------
local int tempface=0, tempgroup=0;
struct{
ubyte DEADBEEF[16];
uint unk1[5];
int numBones;
int ofsBones;
int sizeBones;
int unk2[30];
int numMats;
int ofsMaterial;
int sizeMaterial;
if(ofsBones)
{
struct{
FSeek(ofsBones + 16);
struct BONE bone[numBones]<optimize=false>;
}Bones;
}
Printf("mtllib default.mtl\n");
if(ofsMaterial)
{
struct{
FSeek(ofsMaterial + 16);
struct MATERIAL material[numMats]<optimize=false>;
}Mats;
}
}HEADER;
struct BONE{
char Name[64];
int parent_id;
float unk1[34];
int unk2[7];
int unk3;
//Printf("%d;%s\n",parent_id,Name);
};
struct MATERIAL{
local int ftemp;
int unk1;
int numVerts;
int ofsVerts;
int sizeVerts;
int unk2;
int ofsNormals;
int sizeNormals;
int unk3;
int numFaces;
int ofsFaces;
int sizeFaces;
int unk5[7];
char name1[128];
char name2[128];
float funk1[11];
ftemp = FTell(); // save position for later
if(ofsVerts)
{
struct{
FSeek(ofsVerts + 16);
struct VERTEX vert[numVerts]<optimize=false>;
}Verts;
}
if(ofsNormals)
{
struct{
FSeek(ofsNormals + 16);
struct NORMAL normal[numVerts]<optimize=false>;
}Normals;
}
Printf("g Mesh%03d_%s\n",tempgroup,name1);
Printf("usemtl %s\n",name1);
if(ofsFaces)
{
struct{
FSeek(ofsFaces + 16);
struct FACE face[numFaces/3]<optimize=false>;
}Faces;
}
tempface += numVerts;
tempgroup++;
FSeek(ftemp); // restore position, next mesh
};
struct VERTEX{
local float tu,tv;
float x;
float y;
float z;
int unk1;
int unk2;
int unk3;
ushort texu;
ushort texv;
int unk3[4];
tu = texu;
tv = texv;
tu -= 32767;
tv -= 32767;
tu /= 512;
tv /= 512;
tv *= -1;
tv += 1;
Printf("v %f %f %f\n",x,y,z);
Printf("vt %f %f\n",tu,tv);
};
struct NORMAL{
int unk1;
float unk2;
int unk3;
float unk4;
int unk5;
float unk6;
//Printf("vn %f %f %f\n",unk2,unk4,unk6);
};
struct FACE{
ushort f1;
ushort f2;
ushort f3;
Printf("f %d/%d/%d %d/%d/%d %d/%d/%d\n",
tempface+f1+1,tempface+f1+1,tempface+f1+1,
tempface+f2+1,tempface+f2+1,tempface+f2+1,
tempface+f3+1,tempface+f3+1,tempface+f3+1);
};