1. Are you planning to upload your awesome tool to Hive? Please review the rules here.
    July 9, 2018: The rules for the Tool Section have been revised. Please be sure to read the revisions.
    Dismiss Notice
  2. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  3. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  4. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  5. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  6. The results are out! Check them out.
    Dismiss Notice
  7. The poll for Hive's 12th Concept Art Contest is up! Go cast your vote for your favourite genie!
    Dismiss Notice
  8. The raddest synthwave tracks were chosen - Check out our Music Contest #12 - Results and congratulate the winners!
    Dismiss Notice
  9. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

MDX/M3 Optimizer

Submitted by GhostWolf
This bundle is marked as approved. It works and satisfies the submission rules.
This tool originates from here

This tool minifies MDX and M3 files.

For MDX files, it does the following:
  • Changes the precision of all the big floating point data sequences (VRTX, NRMS, UVBS, PIVT, all chunks of the form K***).
  • Removes useless key frames.
  • Changes all bezier and hermite keyframes to linear keyframes.

For M3 files, it does the following:
  • Changes the precision of all the big floating point data sequences (vertex positions, REAL, VEC2, VEC3, VEC4, QUAT, BNDS, IREF).

This tool is a command-line tool, meaning there is no graphical user interface.
You can either run it through a console (cmd), which gives you full control over the options (run it with no arguments to see the list of options), or simply grab files or directories and drop them into it, which will use the default values.

The default values are:
  • Floating point precision: 16.
  • Threshold: 0.001.
  • Force linear keyframes: false.

Floating point precision goes from 10 to 32, where 32 does nothing, and 10 will probably make your model useless.
Note that this wont directly reduce the size of the file, however any map that imports that file will be smaller than the same map importing the original file.
This idea was taken from MDX Squisher.

The threshold is used to compare keyframes, you can make it bigger to remove more keyframes, at the risk of getting bad animation data.

Forcing keyframes to be linear means deleting their in/out tangents, which makes every hermite/bezier keyframe take a third of the original size.
This can cause gigantic size reductions for models with many hermite/bezier keyframes, at the cost of a lower quality animation (though in most cases our eyes can't really see the difference).

The zip has three files, copt_win, copt_lin, and copt_mac, for Windows, Linux, and Macintosh respectively.

Keywords:
mdx, m3, squish, compress, minify, optimize
Contents

MDX/M3 Optimizer (Binary)

Reviews
Moderator
21:28, 13th Nov 2013 PurgeandFire: Approved. A great step-up from mdx squisher with its extra options. Useful for any sc2 modder as well.
  1. jonbon29

    jonbon29

    Joined:
    Aug 19, 2014
    Messages:
    1,096
    Resources:
    0
    Resources:
    0
    Great and very use tool.
     
  2. Kakerate

    Kakerate

    Joined:
    Oct 18, 2013
    Messages:
    471
    Resources:
    0
    Resources:
    0
    Hmm..Perhaps the models i tried to optimize have already been optimized, because I used this and Mdx Squisher and it reduced the size of my map by 1194 bytes :p
     
  3. GhostWolf

    GhostWolf

    Joined:
    Jul 29, 2007
    Messages:
    4,836
    Resources:
    2
    Tools:
    1
    Tutorials:
    1
    Resources:
    2
    Does it say BLP anywhere in the description or title?

    A big part of this optimizer is essentially the same thing as Mdx Squisher (but this tool does it a little better).
    You can also experiment with the keyframe threshold and interpolations if you'd like, where the latter can cause big size reductions (at the price of quality of course) for some models.
    It's all in the description.
     
  4. Ironside

    Ironside

    Joined:
    Feb 3, 2009
    Messages:
    2,723
    Resources:
    4
    Maps:
    3
    Tutorials:
    1
    Resources:
    4
    Is there a way to make it output the statistics about how much things got decreased like in the screenshot? Because when I tried it, it merely does its thing without the output.
     
  5. GhostWolf

    GhostWolf

    Joined:
    Jul 29, 2007
    Messages:
    4,836
    Resources:
    2
    Tools:
    1
    Tutorials:
    1
    Resources:
    2
    I removed the output because there was nothing to actually write about M3 models (at first they also had keyframes removed, but it turned out Starcraft 2 doesn't allow that).
    Either way, though, the statistics were only for keyframes and changing interpolations, not for the floating point optimization, since it doesn't actually change the file size.
    You can just look at the difference between the input file and the output file, but if you want to see how big it will be in an actual map (MPQ), the only way is to put it in one.
     
  6. Kakerate

    Kakerate

    Joined:
    Oct 18, 2013
    Messages:
    471
    Resources:
    0
    Resources:
    0
    Yeah I was going to try to do that, however I don't know how to change the settings. Tried running it through cmd or whatever you instructed in your desc. but I don't know how to. I typed start + the path and name of executable and it just closes immediately. I had to use someone's GUI they made of this. So how do you run it without using default settings?
     
  7. GhostWolf

    GhostWolf

    Joined:
    Jul 29, 2007
    Messages:
    4,836
    Resources:
    2
    Tools:
    1
    Tutorials:
    1
    Resources:
    2
    Run the optimizer with the console to get instructions:
    Code (Text):
    copt_win
    For example, to force linear interpolations:
    Code (Text):
    copt_win -l some_mdx_file.mdx
    You can have multiple inputs, where every input can be an MDX file, or a folder (in which case all MDX files in it, and recursively in folders in it, will be taken as inputs).

    E.g.
    Code (Text):
    copt_win some_mdx_file.mdx folder_with_lots_of_mdx_files
     
  8. GhostWolf

    GhostWolf

    Joined:
    Jul 29, 2007
    Messages:
    4,836
    Resources:
    2
    Tools:
    1
    Tutorials:
    1
    Resources:
    2
    You could always create a batch file, if it's such a nuisance.
    E.g.:
    Code ( (Unknown Language)):

    copt_win -l %1
     

    Then grab files/folders into it as usual.
     

    Attached Files:

  9. DerekX

    DerekX

    Joined:
    Jul 3, 2010
    Messages:
    146
    Resources:
    3
    StarCraft II Resources:
    2
    Tutorials:
    1
    Resources:
    3
    Some .m3 files I try to import into Blender won't, due to a number of "unknown sections". A few others don't seem to import correctly and look mangled. I was hoping this tool would fix all that, it didn't.