• Check out the results of the Techtree Contest #19!
  • Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Model Optimizer and Converter v1.3.0

Model Optimizer and Converter
  • Optimize, sanitize and convert models
  • Batch processing and drag and drop
  • Support for all model formats up to v1200
  • Reforged HD support
  • Check the tooltips for more info about the options
  • Open source

If you encounter any problems or have any more ideas, let me know. When reporting bugs, please attach the model(s) (preferably including custom textures) where the bug occurs so I can test it.

Big thanks to:



1.3.0
  • Note: The source code for v1.2.1 was lost, (1.2.1) marks what I've reimplemented
  • v1100 & v1200 support (thanks @Retera and @eejin!)
  • Replaced Delete Same-ish Keyframes with Delete Identical Keyframes, which no longer breaks animations
    • Ignore Tangents option for more aggressive deleting
    • You can now also set Precision to 2 which enables removal of Hive model checker "roughly the same value" notices
  • (1.2.1) Reimplemented Delete Unused Global Sequences, Delete Invalid Keyframes and Fix Self-referencing Nodes
  • New options:
    • Calculate Extents (new Tools tab)
    • Fix Negative Extents (Sanitization > Warnings tab)
    • Insert Missing Opening Tracks (Sanitization > Severe tab)
    • Delete Unnecessary Keyframes (Optimization > Sequences & Animations tab)
    • HD MDL Compatibility toggle (RMS or Hive, Output tab)
      • MOP can now read both
    • Convert Bones To Helpers (Sanitization > Warnings tab)
  • Delete Fake Triangles will now delete the geoset when all its triangles are fake instead of leaving one fake triangle in place
  • Delete Unused Geoset Animations now ignores bones that refer to them
  • Bind Pose related optimization and sanitization will now only be performed if model version >=900
  • Disable Bind Pose options when selected version <900
  • Merge Similar Geosets will now calculate a new extent
  • Delete Unused Keyframes now also deletes unused Event Object keyframes
  • Clamp Light Attenuation will now change both values with the same amount when possible
  • Added confirmation dialog when trying to close while still processing
  • Added Stop Processing, Pause/Resume Processing, Skip Model and Clear Status buttons
  • Now emits a "No changes made, skipping model." status instead of saving model when no changes are made
  • Tweaked the way status text is displayed and added an error count
  • Taskbar will now flash when the window is inactive and processing is finished or a dialog is shown
  • Option to recreate original folder structure (disabled when target path is empty)
  • Target now required to be a valid absolute path, and also not a file
  • Various small improvements
  • Bug fixes:
    • Removal of the first pivot point
    • Geosets and geoset animations with ID 0 being removed from bones
    • Memory leak where memory usage would keep increasing with each model processed (thanks @Retera!)
    • Options:
      • Delete Unused Textures deleting textures only used by Texture ID animations
      • Merge Identical Textures breaking Texture ID animations
      • Delete Unused Textures & Delete Identical/Sameish Keyframes potentially crashing the program
      • Delete Excess Sequence Extents not working
      • Delete Excess Bind Pose Matrices and Add Missing Bind Pose Matrices not counting cameras and thus potentially corrupting the model
      • Delete Unused Matrix Groups in HD models breaking animations when viewed in RMS
      • Merge Similar Geosets not working
    • Processing continuing after closing the program
    • Models not converting when optimization and sanitization are unchecked
    • (1.2.1) Options sorting (?)
    • Models not being processed when only Sanitize is checked
    • Drag and drop not processing files
    • (1.2.1) Crash when geoset has fewer UVs or normals than vertices
    • Sanitize subtab not being remembered
    • Potential crash when editing/saving models with SkinWeights
    • BindPose MDL reading and writing
    • Potential issue when comparing vertices with skinweights
    • Camera animated rotation being written as int instead of a float
    • Various small fixes


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

1.1.7b
  • Fixed MDL Geoset Extent reading

1.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

1.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

1.1.6 (FIXED)
  • Fixed crash when optimizing
  • Minor fixes

1.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

1.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"

1.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

1.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

1.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

1.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

Previews
Contents

Model Optimizer and Converter (Binary)

after optimize a model, the program set first bone's position to zero, please fix this bug.
Hmm yeah this happens sometimes, I'm not sure when/why but it doesn't always happen IIRC. But I'm not planning on updating this anymore, sorry. Thanks for the rating!
 
Three things:
  • I MIGHT update this in the future, but I'm not sure yet.
  • The code for version 1.2.1 has been lost somehow (guess I forgot to commit it to GitLab, and when I switched computers I got it from GitLab instead of moving it from the old computer - I still have an old laptop and an old PC, I'd probably check those first), so potential next version will probably be lacking its updates. I would leave 1.2.1 in the bundle until all its updates have been reimplemented.
  • I think I've found the cause of the bug where the first node loses its pivot point (coordinates), in model.cpp (line 651) I have if (newObject->objectId > 0 && newObject->objectId < static_cast<int32_t>(pivotPoints.size())) where the first condition should be newObject->objectId >= 0! Oopsie!
 
Some caveats to the above:
  • It's been over five years. I've basically forgotten some of the specifics of C++, most notably memory management, typecasting, and more. As such, I no longer understand much of my own code.
  • By the same token, I no longer really understand the ins and outs of the MDX/MDL formats, contributing to my lack of understanding of my own code.
  • I also don't remember the nature of the changes made in 1.2.1, so if that's truly lost, I might not be able to reimplement those fixes/additions.
  • My primary objective, if I do choose to make an update, is to add support for v1100 and v1200 models, and secondarily to fix bugs. As such, new options are unlikely to be added. I would do my best to at least re-add the options added in 1.2.1.
  • The "Delete Same-ish Keyframes" will either be removed (if I do release a new version), or be replaced with a (functioning) "Delete Identical Keyframes" option.
 
Thanks :grin: What do you mean by overexposed?
Most Warcraft III models have multiple vertices positioned at the same coordinates (X/Y/Z). While this can make some aspects of modeling easier, it unnecessarily increases the final file size. When removing these vertices manually, one by one (a really long and boring task), it is often necessary to redo the UV mapping. However, MOP automatically eliminates all these overlapping vertices without requiring the UV mapping to be redone, saving a lot of time and work, so... one more time, thank u so much buddy:infl_thumbs_up:
 
Most Warcraft III models have multiple vertices positioned at the same coordinates (X/Y/Z). While this can make some aspects of modeling easier, it unnecessarily increases the final file size. When removing these vertices manually, one by one (a really long and boring task), it is often necessary to redo the UV mapping. However, MOP automatically eliminates all these overlapping vertices without requiring the UV mapping to be redone, saving a lot of time and work, so... one more time, thank u so much buddy:infl_thumbs_up:
Ah, I see! My pleasure, I'm glad people find this useful :cool:2

Edit: just checked old pc and laptop, looks like v1.2.1 source code is definitively lost :(
 
Last edited:
I'm so confused.
  • Last commit on GitLab was June 20, 2020
  • Files on my hard drive show last modified August 9, 2020
  • The MDLX parser files on my hard drive are different than the ones on GitLab, but some diffs seem to be older and some seem to be newer?
  • The MDLX parser code is suddenly showing a whole bunch of errors, which obviously wouldn't have been the case back then. Maybe it's because of the new Qt version or newer MinGW version?
  • I tried running the code on my hard drive, and I got an error about an unknown animation tag on a model that works just fine in 1.2.1 - this should not happen on 1.2.0 at all and none of the diffs explain this!

What's going on xD Did I work on it not realizing I had lost the 1.2.1 code or something? Why is it not working as expected? WTF.
Edit: yeah it doesn't really look like I can continue this project, unfortunately :( maybe I can figure something out but don't count on it.
Edit 2: okay, I was able to make the parser compile by switching to MinGW 7.3.0 instead of the latest version, but now MOP itself is refusing to compile and I don't know why.
Edit 3: I'm installing Qt5 instead of the latest version, hopefully that will help. If so, I will probably work from the code on GitLab instead of whatever weird version I have on my hard drive.
 
Last edited:
Good news, I installed Qt5 and used MinGW 7.3.0 instead of the latest version and I was able to run the 1.2.0 code successfully and optimize a model. Hopefully I can add some features and fix some bugs. We'll see.

Edit: okay, despite successfully building, the parser is still showing a bunch of errors. Might have something to do with having two versions of Qt installed or something, idk.
 
Last edited:
Looks like I was right about the cause of the first node losing its coordinates... fixed! ^^ Still don't know why all the errors and warnings are popping up... it compiles and runs fine so I guess I can ignore them, but I really don't like it.

In any case, I won't further spam this thread, there's a changelog and to do list for those interested which I'll keep updated. Still not 100% sure this will result in a new release. But there's a chance it will, so if you have any bugs to report or features to suggest, now's the time :p
 
This is by far the biggest update since I added MDX support! The full changelog is in the description, but here are some highlights:
  • v1100 and v1200 support (thanks @Retera and @eejin!)
  • Improved HD support
  • Delete Identical Keyframes (formerly Delete Sameish Keyframes) now actually works as expected
  • New options: Calculate Extents, Fix Negative Extents, Insert Missing Opening Tracks, Delete Unnecessary Keyframes, HD MDL Compatibility (RMS or Hive) and Convert Bones To Helpers
  • Stop, pause, resume and skip buttons
  • Option to recreate original folder structure
  • Bug fixes:
    • First node no longer loses its pivot point/coordinates
    • Processing no longer continues after closing the program
    • Fixed memory leak causing memory usage to increase with each model processed (thanks @Retera!)
    • Fixed some potential crashes
    • Fixed bugs with several options

Please let me know if you encounter any bugs or if you have any ideas for more options! :grin:
 
so you finally updated the tool. What motivated you?
I'm not sure :P I'd been thinking about it for a while. One day I was looking through the source code and found the cause of the bug where the first node's pivot point was lost, and then I decided to fix it, and from there I couldn't help myself and did the other stuff too.
 
Back
Top