Model Optimizer and Converter v1.2.1

This bundle is marked as approved. It works and satisfies the submission rules.
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 12
Joined
Apr 12, 2018
Messages
407
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.
 

loktar

Model Reviewer
Level 25
Joined
Nov 2, 2004
Messages
1,716
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 12
Joined
Apr 12, 2018
Messages
407
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).
 

loktar

Model Reviewer
Level 25
Joined
Nov 2, 2004
Messages
1,716
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.
 

loktar

Model Reviewer
Level 25
Joined
Nov 2, 2004
Messages
1,716
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 11
Joined
May 16, 2012
Messages
518
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 2
Joined
Nov 1, 2020
Messages
33
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!
 

loktar

Model Reviewer
Level 25
Joined
Nov 2, 2004
Messages
1,716
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 2
Joined
Nov 1, 2020
Messages
33
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 2
Joined
Nov 1, 2020
Messages
33
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 2
Joined
Nov 1, 2020
Messages
33
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 8
Joined
Jul 4, 2016
Messages
482
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 29
Joined
Dec 29, 2014
Messages
1,774
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.
 
Top