How to use ModelCompiler?

Really need your help, I have *.max and *.mif file I need to compile it to *.msh. I think ModelCompiler.exe is used for that, but I allways get this:

ModelCompiler.exe "D:/Games/Steam/SteamApps/common/Grim Dawn/mods/DAIL/source/Meshes/Arcanist.max" -mif "D:/Games/Steam/SteamApps/common/Grim Dawn/mods/DAIL/source/Meshes/Arcanist.mif" "D:/Games/Steam/SteamApps/common/Grim Dawn/mods/DAIL/" "D:/Games/Steam/SteamApps/common/Grim Dawn/mods/DAIL/source/Meshes/Arcanist.msh" -tangents
Incompatible file type

AssetManager does this somehow.

I’m trying to compile assets completely without AssetManager. I’m stuck here.

Edit: If it wants proprietary mdl format, is there any way around AssetManager?
Then I think I just hit the real wall, all I can do is warn users to build meshes in AssetManager.

AFAIK, the ModelCompiler works with model files (.mdl), not with .max files.
The model data is embedded in the .max file.
So what the AssetManager do is to extract the model data to (“c:\Users[YOURUSERNAME]\AppData\Local\Temp”),
then it calls the ModelCompiler with the .mdl file as the first parameter.

edit: I just read your edit too late… Why do you warn users to build meshes in AssetManager? It works for me quite well.

Thanks, How exactly do you extract mdl data? I cannot use 3ds max or similar app to do that. Is there any command line tool? I need to do that programmicaly.

I have no tool (not needed by me) to extract the mdl data, but it should be easy to code one with a few lines.

  1. Load the .max file into a buffer.
  2. Search for the keyword “MDL” (Header: “MDL” + byte 07). This is the start address of the MDL data.
  3. Search for the keyword “ExportDataMDL”. This is the end address of the MDL data.
  4. Now save the buffer from startAddress to endAddress as <filename>.mdl
    That’s all.

You can also use a hexeditor, search for the mdl data and save it as binary data.

Thank you for this info, it was immensely helpful.