OBJ2MDL Batch Converter v1.0.9

This tool allows you to convert .obj (OBJ) models to .mdl (Warcraft 3). To use it simply drop a file into the window, and it will spit out converted .mdl file in the folder of the obj file.

Notes:
  • If faces have to be triangulated from quads or ngons, the normals are not recalculated. Recalculate them post-conversion.
  • If generating bones for each object/geoset, their centroids/pivotPoints are not calculated.
  • Extents are not calculated. Calcualate them post-conversion.
  • Animations are not supported

Bonus to converted mdl file:
  • origin ref
  • geoset/s attached to bone/s, and using material with layer using texture "Textures\white.blp"
  • stand and death sequence

This tool requires .NET 3.5 so try installing that if the tool does not start for you.


NOTE: If the converted model seems empty, it's probably because it is really small. Scale it up. (Depends on the program you exported it with)
NOTE:
MDLVis will not open it correctly because its parser is not as flexible, so a workaround is - open-save with MAGOS editor and then open in mdlvis

Source Code on GitHub



1.0.5: (16/09/24):

  • updated validator's regex checks for vertex, normal and face

1.0.6: (29/09/24):
  • updated the validating regex for object "o "
  • updated the valdiating regex for mtllib
  • added a validating regex for validating "l " line
1.0.7 (30/09/24):
Timestamp update
Title update
NumGeosets included in the model properties that helps be parsed by other apps
Geoset string formatting updated

1.0.7.1 (06/10/24)
- Validator now ignores empty line
1.0.7.2 (06/11/24)
  • Validator now recognizes mtllib
  • if file exists you are asked to overwrite
1.0.8 (15/11/24):
- you can now also select multiple files with a dialog by clicking on the label

v1.0.9 (22/11/24):
- you can now mass convert obj files by associating the .obj file extension with the app, and double clicking on them :p

Contents

OBJ2MDL Batch Converter (Binary)

Reviews
eejin
The new version correctly converts some test models. Simple but useful

eejin

Tool Moderator
Level 12
Joined
Mar 6, 2017
Messages
234
I tried a basic .obj file (a cube) but could not load it succesfully. The errorr I get is:
1726433245721.png

I have included the contents of the .obj file below
# cube.obj
#

g cube

v 0.0 0.0 0.0
v 0.0 0.0 1.0
v 0.0 1.0 0.0
v 0.0 1.0 1.0
v 1.0 0.0 0.0
v 1.0 0.0 1.0
v 1.0 1.0 0.0
v 1.0 1.0 1.0

vn 0.0 0.0 1.0
vn 0.0 0.0 -1.0
vn 0.0 1.0 0.0
vn 0.0 -1.0 0.0
vn 1.0 0.0 0.0
vn -1.0 0.0 0.0

f 1//2 7//2 5//2
f 1//2 3//2 7//2
f 1//6 4//6 3//6
f 1//6 2//6 4//6
f 3//3 8//3 7//3
f 3//3 4//3 8//3
f 5//5 7//5 8//5
f 5//5 8//5 6//5
f 1//4 5//4 6//4
f 1//4 6//4 2//4
f 2//1 6//1 8//1
f 2//1 8//1 4//1
 
I tried a basic .obj file (a cube) but could not load it succesfully. The errorr I get is:
View attachment 488195
I have included the contents of the .obj file below
Yes this is the validator checking. and it uses regex so the problem cannot be local formatting.

It worked for me? Did you do anything else to that model? I need more details to figure out why it didnt work for you
I Will check the regexes

Try testing with more models. Before uploading it I tested with multiple models and it worked fine.

EDIT: updated with changed regexes
 
Last edited:
Level 68
Joined
Dec 23, 2013
Messages
1,433
(Version 1)
I got no error, but I also got a .MDL with no geosets at all when it converted.

(Post-patch)
It works!
If you try opening the .MDX the tool creates on it's own with MdlVis, you'll get an error, but there's an easy workaround:
Open the .MDX with War3ModelEditor and export the Geoset from there for use in other models (Tested)

Updating my rating now - 4/5
Quick work man, thanks!
 
Last edited:
MilkShape 3D already has the ability to convert from obj to mdl. If your tool were to support directly converting FBX to MDL, it would be very powerful.
1. Milkshake cannot save to mdl. It can only import mdx. Magos editor can import mikshape models. You meant open obj wth milkshape, save as milkshape and import with magos editor. I used to do that until I made this app, and it shortcuts the process.
2. Batch convert vs single convert.
3. Saying "Your tool is kinda useless because there are others that can do that" is kinda rude dont you think?
 
Last edited:
1. Milkshake cannot save to mdl. Magos editor can import mikshape models. You meant open obj wth milkshape, save as milkshape and import with magos editor.
2. Batch convert vs single convert.
3. Saying "Your tool is kinda useless because there are others that can do that" is kinda rude dont you think?
I don't know my Milkshape can export to mdl or mdx and even with animations if done right.
I have been using it for years now.
You can get it from this thread:
 
1. Milkshake cannot save to mdl. It can only import mdx. Magos editor can import mikshape models. You meant open obj wth milkshape, save as milkshape and import with magos editor. I used to do that until I made this app, and it shortcuts the process.
2. Batch convert vs single convert.
3. Saying "Your tool is kinda useless because there are others that can do that" is kinda rude dont you think?
Oh, I'm sorry, man. Please forgive my "rude" reply. Because my MilkShape 3D 1.8.5 really has the function of directly importing/exporting mdx/mdl (maybe with some plugins attached), so I wonder why you would make a tool like this. Indeed, your batch function is a unique advantage, thank you for your gives.
Speaking of which, have you ever thought about converting models from FBX format? After all, usually converting animated character models is a troublesome task.
0000000.jpg
 
Last edited:
Oh, I'm sorry, man. Please forgive my "rude" reply. Because my MilkShape 3D 1.8.5 really has the function of directly importing/exporting mdx/mdl (maybe with some plugins attached), so I wonder why you would make a tool like this. Indeed, your batch function is a unique advantage, thank you for your gives.
Speaking of which, have you ever thought about converting models from FBX format? After all, usually converting animated character models is a troublesome task.
View attachment 492026
Thanks for your suggestion! The program is complete as it is, and I don't have plans to add FBX support. If you're looking for a tool that handles FBX, you might want to explore other options.
 
Top