• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Model Optimizer and Converter v1.2.1

Model Optimizer and Converter
  • Batch processing.
    • Drop files/folders on the window
  • Reforged support
    • MDL output can't be read by Retera's Model Studio 0.4
  • Check the tooltips for more info about the options
  • Separate CMD executables
    • --help for info about the options
    • Drop files/folders on the executables

Big thanks to @GhostWolf and @Retera for their help, their code, and their software.
Also a big thanks to @Macadamia for his invaluable feedback.
And thanks to @eejin for improving the UI theme.



1.2.1
- Fixed a crash that could occur when a geoset has no UVs or normals
- Fixed options sorting
- New options: Delete Unused Global Sequences, Delete Invalid Keyframes, Fix Self-referencing Nodes
- Small UI tweaks

1.2.0
- Fixed a crash that could occur when a geoset has an invalid matrix
- Delete same-ish keyframes
- Split "Match Sequence Extents" into delete (opt) and add (sanity)
- Added a few sanitization options
- Improved theme

1.1.11a
- Tweaked UI
- External stylesheet (style.css)

1.1.11
- Fixed nodes sometimes losing their parent node
- Fixed missing PE2 gravity field
- Fixed PE2 width and length fields being inverted when writing to MDX files
- Added percentage to filesize reduction message

1.1.10
- Added Delete Unused Bones/Helpers/Event Object options
- Added "Pass 1/2/..." messages
- UI style based on Hive

1.1.9a
- Fixed crash on program exit

1.1.9
- Implemented all animated objects
- Delete 0-Length global sequences
- Delete unknown chunks
- Remember active subtab

1.1.8
- Added Geoset Animation options
- Implemented Lights

v1.1.7b
- Fixed MDL Geoset Extent reading

v1.1.7a
- Fixed material merging
- Fixed global sequence unused keyframes deleting
- Fixed node hierarchy being partially destroyed
- Fixed crash when merge similar geosets is checked

v1.1.7
- Fixed Materials & Textures optimizations
- Added Merge Similar Geosets option
- Geosets left empty after deleting free vertices are now deleted
- Adding sequence extents now takes the geoset extent if no sequence extents are available
- Fixed Optimization options not being disabled when Optimize is unticked

v1.1.6 (FIXED)
- Fixed crash when optimizing
- Minor fixes

v1.1.6
- Removed recursive optimization option (always recursive)
- Delete 0-length sequences
- Partial Linearize Anims
- Partial delete unused keyframes
- Partial delete empty animations
- Delete Unused/Merge Identical Materials, Textures & Texture Animations
- Misc fixes

v1.1.5
- Considering normals when merging vertices is now optional (default off)
- Added "Delete 0-length Sequences" option
- Removed "Reforged Data" checkbox (always written now)
- Changed window title to "MOP"

v1.1.4
- Fixed 0-value Tangents and SkinWeights being written to >v800 models without this data
- Improved RMS 0.4 Reforged MDL reading
- Misc fixes

v1.1.3
- Fixed a bug with writing MDX files without any FaceFX
- Miscellaneous bugfixes/crash fixes
- Added partial support for reading Reforged MDL files written by RMS 0.4
- Unknown tokens will once again cause MDL loading to fail
- Moved suffix options to Optimize and Convert Options respectively
- Magos Compatibility now only applies to v800 models
- Magos Compatibility disabled when Version 900/1000 checked
- Fixed CMD processing
- Changed the way CMD options/arguments work

v1.1.2
- Fixed a crash that could occur when merging vertices
- Merging vertices is now faster
- Merging vertices now requires identical vertex groups
- Fixed a bug with writing Color to Geoset Animations
- Fixed automatic filenaming (increment & suffix)
- Fixed ignored tokens' attributes not being skipped
- Checkboxes are now disabled when appropriate

v1.1.1
- Changed UI layout a bit
- Added radio buttons for preselection of file conflict handling
- Improved messages and added filesize difference
- It' now possible to process files when neither Optimize or Convert are checked
- Added "suffix" option for file conflicts
- Fixed a bug that would sometimes cause a crash
- Fixed Reforged model optimizing causing a crash
- Fixed Reforged data not being written to MDL files when not converting
- Unknown tokens will no longer cause parsing MDL files to fail
- Fixed layer TextureID token not being recognized
- Improved floating point rounding

If you encounter any problems or have any more ideas, let me know :)
GitLab repo
Previews
Contents

Model Optimizer and Converter (Binary)

Level 20
Joined
Apr 12, 2018
Messages
494
I don't suppose you can explain to me which set of options tells the optimizer to not touch Particle Emitter Visibility or change Geoset Animation alphas? Those are the things that the current program likes to mess up for me.

Otherwise, so far the optimizer doesn't appear to do anything weird like the MDX / M3 tool does when squishing UVs (I'd seen a lot of cases where it makes new 'seams' at the edges so changing that can sometimes be dangerous), although I think some of the optimizations are a little too aggressive, but a least they're toggle-able.

It's also one of the few tools out there I've noticed that handles extents although I suppose it's actually the same as Magos.
 
Most likely that's caused by Delete Same-ish Keyframes, but without more info I can't be sure. That option has a few issues I think, hopefully will be able to resolve it in the future.

Which options are too aggressive in your opinion?

As for the extents, it doesn't really handle them per se. Just deletes excess ones and adds missing ones by copying or adding 0-value extents. No calculation is done or anything like that.
 
Level 20
Joined
Apr 12, 2018
Messages
494
Which options are too aggressive in your opinion?
Off the top of my head I disagree with removing a 0-length Global Sequence since I've found some use for that (like I said it's toggle-able, I can at least stop it from 'helping')

Okay, opening up the module personally I have everything on Materials and Textures unchecked. I have Merge Similar Geosets unchecked for the same reason (the two categories are related, but I understand why this one is in the next tab).

I don't think I understand what Delete Duplicate Geoset Animations is really about when Delete Unused Geoset Animations is right next to it (the latter in my mind should have taken care of that since each geoset can only have one geoset animation).

I think it's really just my personal practical tastes fighting with what can be optimal, and honestly it doesn't matter what I think as long as I can turn them off (because I can't say it isn't what other people want).
 
Hmm, maybe I should turn off 0-length globals by default, maybe duplicate geoanims too. The latter always deletes all of them except the first one, which may not be what the user wants.
Geosets can have multiple geoset animations, but it leads to buggy behaviour (best case scenario only one is actually used), afaik MdlVis can sometimes cause multiple geoanims per geoset (its visibility/alpha stuff is quite buggy), and in Magos you can do it manually (though I assume no one would do that except by accident).

I've thought about adding a preset feature, with safe and aggressive defaults and the ability to make custom presets. Not sure if I'll get to it though.
 
Level 20
Joined
Apr 12, 2018
Messages
494
Took me a while, but I figured out that one of the settings I do have on is setting the position of Pivot Point for Object 0 at {0, 0, 0} regardless of where it was before. Obviously this does nothing if Object 0's position doesn't matter, but if it is a joint it messes up everything.
 
This is a great tool, but just wanted to point out that for some models, just processing using this tool even without optimizer or sanitization ticked on causes some animations to brake.
Might be caused by this:
Took me a while, but I figured out that one of the settings I do have on is setting the position of Pivot Point for Object 0 at {0, 0, 0} regardless of where it was before. Obviously this does nothing if Object 0's position doesn't matter, but if it is a joint it messes up everything.
Try copying back the original values into the top object and see if that fixes it.

This is first on my to do list to fix whenever I get back to work on this :p
I think it always happens, don't think it's related to a particular setting.
 
Last edited:
Level 20
Joined
May 16, 2012
Messages
635
Might be caused by this:

Try copying back the original values into the top object and see if that fixes it.

This is first on my to do list to fix whenever I get back to work on this :p
I think it always happens, don't think it's related to a particular setting.

By copying you mean converting the model to mdl, opening it with a text editor going down to PivotPoints and reverting the 3 values back to what they where in the original model?

EDIT: Yeah, that solves the problem alright! Thanks and Good Job!
 
Last edited:
Level 3
Joined
Nov 1, 2020
Messages
34
In the "Output" tab, uncheck "_opt Suffix".
Oh, my bad, thank you very much!
In this tool, some models's animaiton are broken, have any idea ?
although, this tool is very good, minus point i seem maybe is when optimizer multi models in many folder (compress units folder is a example), model only put in a folder and don't create folder like original
If it's a feature, sory about my bad!
 
In this tool, some models's animaiton are broken, have any idea ?
Make sure to uncheck "Delete Same-ish Keyframes", that option is bugged at the moment.

Otherwise it could be because of this bug:
Took me a while, but I figured out that one of the settings I do have on is setting the position of Pivot Point for Object 0 at {0, 0, 0} regardless of where it was before. Obviously this does nothing if Object 0's position doesn't matter, but if it is a joint it messes up everything.
In which case, try copying back the original values into the top object and see if that fixes it.

minus point i seem maybe is when optimizer multi models in many folder (compress units folder is a example), model only put in a folder and don't create folder like original
This is a good idea, maybe I'll implement it in the future. Right now you can only put everything in one folder or put it in the same folder as the source file.
 
Level 3
Joined
Nov 1, 2020
Messages
34
Make sure to uncheck "Delete Same-ish Keyframes", that option is bugged at the moment.

Otherwise it could be because of this bug:

In which case, try copying back the original values into the top object and see if that fixes it.


This is a good idea, maybe I'll implement it in the future. Right now you can only put everything in one folder or put it in the same folder as the source file.

thank you!
 
Level 3
Joined
Nov 1, 2020
Messages
34
Those are bugs in the model itself. I believe the tool just ignores these, if the model is still being written it should be ok. Otherwise you will have fix it some other way.
I still have error in animation and model (in few models) and....a model was miniature, very small compared to the original size.
except for them, all is fine
upload_2020-12-26_9-41-46.png

upload_2020-12-26_9-45-9.png
 
Last edited:
Level 3
Joined
Nov 1, 2020
Messages
34
Hmm, could be Delete Unused/Duplicate Geoset Animations, in some rare cases it is a bit bugged. The miniature one, maybe delete 0-length global sequences?
I don't have much knowlegde about model, but.... do you have any idea to fix miniature model ?

edit : i was fix model
 
Last edited:
Level 11
Joined
Jul 4, 2016
Messages
626
After using this tool, it reduces the size of the model alot better than mdx optimizer without distorting the face, too.

However, I ran into a problem, which option causes certain geosets to no longer be hidden during specific animations though?
 
Level 50
Joined
Dec 29, 2014
Messages
1,948
After using this tool, it reduces the size of the model alot better than mdx optimizer without distorting the face, too.

However, I ran into a problem, which option causes certain geosets to no longer be hidden during specific animations though?
That's probably because of the "linearizing animations" option that exists both in Mdlvis program. It causes the same problems. I'd suggest you tinker with the geoset animations and particle emitters after optimizing the model.
 
Level 1
Joined
May 14, 2021
Messages
8
Getting corpses under units whenever they're doing anything other than standing. Not sure what I'd doing wrong.

Does carve down on the size of units heaps though.
 
This tool feels excellent to me, have used plenty of time to optimize models, the only hiccup I had recently is 1 option messing up geoset animation (Delete same-ish keyframe).
You took the time to wrote tooltips for the options when you hover the cursor over them, that really nice.
I'd like to use the command line to test some stuff but I don't know/understand how to reproduce the settings from the GUI.
 
If I understand correctly, it changes the precision of some of the binary data, which almost certainly won't be added in this tool.
The deleting of useless keyframes may be added here, and linearizing animations definitely will be. It depends on how much time I end up putting into this.

This tool optimizes by deleting useless data and merging duplicate data (e.g. identical vertices). Both tools can be used together.
How would one use both tools together?
 
Level 11
Joined
Jul 4, 2016
Messages
626
What option causes models to stretch their bones/bodies after using this tool?
If this is models stretching across the screen, then some vertexes must not be connected to a bone. Try unchecking the delete unused bones and helpers

also is this in game, the editor, or a model editor? I seen stretching in magos/mdlvis before where in game, it does not occur.
 
If this is models stretching across the screen, then some vertexes must not be connected to a bone. Try unchecking the delete unused bones and helpers

also is this in game, the editor, or a model editor? I seen stretching in magos/mdlvis before where in game, it does not occur.
It's in all three so I will try that though the squisher helped so much more by reducing its size by 75% when inside a map, but every penny counts.

Edit: Yup that was exactly the problem, thank you.
 
Level 11
Joined
Jul 4, 2016
Messages
626
Optimizing without/with any options appears to be causing some model's animations to break. For instance, after optimizing even without any options checked caused my walk animation to swap left to right.
 
Last edited:
Level 11
Joined
Jul 4, 2016
Messages
626
No, this does alot more stuff than RMS does in terms of optimizing. I use them both together though since their methods of deleting key frames seem to be different.
 
Level 11
Joined
Jul 4, 2016
Messages
626
For my own methology, thought I will suggest experiment to what work best for you, I utilize RMS, then this then mdx squisher last.
 
Level 11
Joined
Jul 4, 2016
Messages
626
There appears to be some models where the thing will just keep passing forever. If anyone or maybe if the creator ever comes back, please reveal what possibly reason could be causing this, is it the complexity of the model?
 
Top