Is there currently any software allowing to edit these files or maybe a compiler which change them to as usable format?
If not, is anyone looking into this matter or do we have to wait until ES releases some tool or compiler?
[question] .xmf files
Moderators: Scripting / Modding Moderators, Moderators for English X Forum
-
- Posts: 5345
- Joined: Fri, 30. Dec 05, 17:47
-
- Posts: 61
- Joined: Fri, 6. Oct 06, 15:18
-
- Posts: 61
- Joined: Fri, 6. Oct 06, 15:18
Code: Select all
// header
char magic[4]; // = {'X', 'U', 'M', 'F'}
short version; // 0x0003 (3) ???
short chunkOffset; // 0x0040 (64) ???
char chunkCount; // 2 <= N <= 11
char chunkSize; // 0x38 | 0xBC (56 | 188)
char materialCount;
char unknown1; // 0x88 (136)
char unknown2; // 0x01 (1)
char unknown3; // 0x00 (0)
int vertexCount;
int indexCount; // (number of triangles) x 3
int unknown4; // 0x00000004 (4)
int unknown5; // 0 - models, 1 - collision ???
char zeros[34]; // 34 x 0x00
// chunks
// absolute offset (64)
{
int id1; // 0|2|3|4|6|8|30
int part; // 0|1|2|3|4 (++ when current.id1 == prevouis.id1) (101 - error?)
int offset // relative to gzipped data start
int one1; // 0x00000001 (1)
int zero; // 0x00000000 (0)
int id2; // 1|2|4|15|16|30|31|32
int size; // packed size
int elementCount;
int bytesPerElement;// 2|4|8|12|16|20|24|28|32|36|40|44|48|60|64
int one2; // 0x00000001 (1)
char unknownData[chunkSize - 40]; // 16|148 bytes
}
// ...
// repeat (chunkCount) times
// materials
// absolute offset (64 + chunkCount * chunkSize)
if materialCount > 0 {
{
int indexStart;
int indexCount;
char materialName[128];
}
// ...
// repeat (materialCount) times
}
// gzipped data
// absolute offset (64 + (chunkCount*chunkSize) + (materialCount*136))
char data[];
[ external image ] [ external image ] [ external image ] [ external image ] [ external image ]
known chunks:
id1=0, id2=2, bytesPerElement=12 — vertex buffer; point(float, float, float)
id1=30, id2=31, bytesPerElement=4 — index buffer; face(int, int, int)
id1=30, id2=30, bytesPerElement=2 — index buffer; face(short, short, short)
...
Last edited by hhr on Thu, 28. Nov 13, 08:48, edited 1 time in total.
-
- Posts: 773
- Joined: Thu, 18. Dec 03, 09:00
-
- Posts: 61
- Joined: Fri, 6. Oct 06, 15:18
-
- Posts: 61
- Joined: Fri, 6. Oct 06, 15:18
test converter to Wavefront OBJ - https://github.com/hhrhhr/Lua-utils-for-X-Rebirth
usage:
output_dir - default "."
output_name - default "out" (out.obj + out.mtl)
not all models can be converted. if instead of the "output_name" write "dump", then the script will extract the binary data (header and body) for further study.
Capital Destroyer:
[ external image ][ external image ][ external image ][ external image ][ external image ][ external image ]
usage:
Code: Select all
tools\luajit.exe lua\xmf2obj.lua path_to_xmf [output_dir [output_name|dump]]
output_name - default "out" (out.obj + out.mtl)
not all models can be converted. if instead of the "output_name" write "dump", then the script will extract the binary data (header and body) for further study.
Capital Destroyer:
[ external image ][ external image ][ external image ][ external image ][ external image ][ external image ]