1. The long-awaited results for Concept Art Contest #11 have finally been released!
    Dismiss Notice
  2. Join Texturing Contest #30 now in a legendary battle of mythological creatures!
    Dismiss Notice
  3. The 20th iteration of the Terraining Contest is upon us! Join and create exquisite Water Structures for it.
    Dismiss Notice
  4. Hivers united and created a bunch of 2v2 melee maps. Vote for the best in our Melee Mapping Contest #4 - Poll!
    Dismiss Notice
  5. Check out the Staff job openings thread.
    Dismiss Notice

Mdx sanity tester

Discussion in 'Modeling & Animation' started by GhostWolf, Dec 14, 2016.

  1. GhostWolf

    GhostWolf

    Joined:
    Jul 29, 2007
    Messages:
    4,836
    Resources:
    2
    Tools:
    1
    Tutorials:
    1
    Resources:
    2
    Welcome to the sanity tester!
    A tool that looks for issues in models (*.mdx, *.mdl) and textures (*.blp).

    There isn't much to do to start - simply open up the tester, and start testing.

    To load things, you need to grab and drop them anywhere on the tester page:
    • Local files from your computer.
    • Links to Hive thread/pastebin attachments.
    • Links to Hive resources.
    See the attached images.

    For models, the test will report errors, warnings, and unused objects (either because they are really not used, or due to some error/warning).
    Errors are things that will cause the model to either not load at all, or otherwise crash the game or the World Editor.
    Warnings are more lenient, and in many cases might not affect how the model ends up behaving.

    The texture test is a far simpler, and the rules aren't so much known to me, so for now any issue will be reported as a warning.



    Did a model work in the game but not pass the test? did a model pass when it shouldn't have? any other issue? please post it.
    HOWEVER, before doing so, open up your browser's console (F12 usually), and copy any errors that show up.

    If you see problems with the viewer, rather than the test, I would prefer if you post them in the viewer's thread.



    depracated list of errors and warnings

    Errors

    Error Causes Fix
    Corrupted texture path (doesn't end with ".blp" or ".tga") Model can't be loaded Fix the path
    A geoset animation references an invalid geoset Loads in the World Editor. If preplaced in the map, the map will get stuck while loading. If created after map initialization, the geoset animation does nothing Reference a valid geoset
    Corrupted attachment path (doesn't end with ".mdl") ? Fix the path
    Corrupted particle emitter path (doesn't end with ".mdl") ? Fix the path
    A ribbon emitter references an invalid material Loads in the World Editor. Crashes the game while the map loads Reference a valid material
    An event object references an invalid global sequence ? Reference a valid global sequence, or None
    An event object with zero keys Model can't be loaded Add keys, or remove the event object
    A node with an invalid parent ID Model can't be loaded Fix it
    A node with the same object ID and parent ID Crashes the World Editor the moment you click on the unit button in order to place it somewhere Fix it
    A tracks chunk references an invalid global sequence Crashes the World Editor the moment you select the model file in the Object Editor Reference a valid global sequence, or None

    Warnings

    Warning Causes Fix
    Unknown version ? ?
    No sequences Can cause issues with some use cases Add sequences
    No "stand" sequence Can cause issues with some use cases Add a "stand" sequence
    No "death" sequence Can cause issues with some use cases Add a "death" sequence
    A sequence with a negative frame Probably defined as unsigned, and so the real frame will be HUGE* Don't have sequences with negative frames
    A global sequence with 0 length Uses the first track, regardless of its frame Don't have global sequences with 0 length
    A global sequence with negative length Probably defined as unsigned, and so the real length will be HUGE* Don't have global sequences with negative lengths
    A texture defines both a path and a replaceable ID The path is ignored* Remove the path
    A texture uses an unknown replaceable ID Does nothing Use a known replaceable ID
    A material has no layers ? Add layers, or remove the material
    A material uses an invalid filter mode ? Change the filter mode
    A vertex is not attached to any bone The vertex will be attached to the map's center Attach it to something
    A geoset is referenced by multiple geoset animations The last one is used* If the model works properly, remove the useless geoset animations, otherwise, check it
    There are geoset animations, but no geosets ? Remove the geoset animations
    A bone references an invalid geoset Nothing Reference a valid geoset
    A bone references an invalid geoset animation Nothing Reference a valid geoset animation, or None
    A light uses non-recommended attenuation values ? Stay in the range min=80 max=200
    No pivot points A default one is created at the origin* Add pivot points
    A particle emitter 2 uses an invalid filter mode ? Change the filter mode
    A tracks chunk has 0 tracks ? Add tracks, or remove the tracks chunk
    A tracks chunk references a sequence, but there are no sequences ? If you meant to reference a global sequence, do so. If you have no global sequence to reference, and no sequences, then why do you have animation data in the first place?
    A track has a frame that isn't in any sequence (ignores frame 0) Does nothing* Don't have tracks outside of sequences
    A track has a negative frame ? Don't have tracks with negative frames
    A track chunk has tracks in a sequence, but no opening track for that sequence Can cause weird animations Add an opening track
    A track chunk has tracks in a sequence, but no closing track for that sequence Can cause weird animations Add a closing track
    A visibility tracks chunk uses an interpolation type that is not None It is set to None* Change the interpolation type to None


    * This is an educated guess, but a guess nonetheless.
     

    Attached Files:

    Last edited: Apr 16, 2018
  2. TriggerHappy

    TriggerHappy

    Code Moderator

    Joined:
    Jun 23, 2007
    Messages:
    3,578
    Resources:
    22
    Spells:
    11
    Tutorials:
    2
    JASS:
    9
    Resources:
    22
    Seems nice.

    Bootstrap CSS is your friend.
     
  3. GhostWolf

    GhostWolf

    Joined:
    Jul 29, 2007
    Messages:
    4,836
    Resources:
    2
    Tools:
    1
    Tutorials:
    1
    Resources:
    2
    Changed a geoset being reference by multiple geoset animations to a warning.
    This is apparently loadable by the game (uses the last one, as far as I can tell).
     
  4. Emm-A-

    Emm-A-

    Joined:
    Jul 1, 2008
    Messages:
    1,311
    Resources:
    0
    Resources:
    0
    how cool, I will definitely test it on some models, I managed to fuck up somehow. This would be really great for modelling newbies like me ...
     
  5. The_Silent

    The_Silent

    Joined:
    Feb 4, 2008
    Messages:
    2,747
    Resources:
    155
    Models:
    45
    Icons:
    89
    Packs:
    8
    Skins:
    12
    Maps:
    1
    Resources:
    155
    Will work really well for moderation if it is easy enough to use.
     
  6. GhostWolf

    GhostWolf

    Joined:
    Jul 29, 2007
    Messages:
    4,836
    Resources:
    2
    Tools:
    1
    Tutorials:
    1
    Resources:
    2
    Hopefully integration will be better in the future.
    If you have suggestions, go for it.

    /Edit
    The game seems to support a texture having both a path and a replaceable ID - it simply ignores the path.
    This will be left as a warning.
     
    Last edited: Dec 15, 2016
  7. GhostWolf

    GhostWolf

    Joined:
    Jul 29, 2007
    Messages:
    4,836
    Resources:
    2
    Tools:
    1
    Tutorials:
    1
    Resources:
    2
    I made the test quite more advanced, and updated the main post with nice tables.

    Note that there are many question marks.

    If you have any broken models, or know what to fill the blanks with, do share.

    Some of the question marks I have seen in the past, but no longer have the models, and have no idea if they worked in-game or not.
     
    Last edited: Dec 17, 2016
  8. A Void

    A Void

    Joined:
    Mar 29, 2011
    Messages:
    2,472
    Resources:
    10
    Models:
    2
    Spells:
    1
    Tutorials:
    7
    Resources:
    10
    This should be really useful for model moderators.
     
  9. GhostWolf

    GhostWolf

    Joined:
    Jul 29, 2007
    Messages:
    4,836
    Resources:
    2
    Tools:
    1
    Tutorials:
    1
    Resources:
    2
    Fixed bugs, and changed global sequences with zero length to a warning, since it's load-able (I assume it does nothing).

    In general it makes sense to me that all of the current errors will result in models that cannot be loaded, but I can't verify it.
    The difference between the error section and the warning section, as they stand, is that the error section is all about invalid references to objects in the model, for which there can be no default values, while the warning section is made of lots of things the game might as well have defaults for.

    Beside the zero length global sequences, the test spew no errors for all of the Warcraft 3 1.26 models.

    /Edit
    Tested a couple of the errors, see updated tables.

    Added a test for sequence names. It only checks if the first token is one of the main token list (attack, birth, cinematic, death, decay, dissipate, morph, portrait, sleep, spell, stand, walk).
    I am not quite sure how sequence names work, so if more needs to be checked, do say.
     
    Last edited: Dec 20, 2016
  10. GhostWolf

    GhostWolf

    Joined:
    Jul 29, 2007
    Messages:
    4,836
    Resources:
    2
    Tools:
    1
    Tutorials:
    1
    Resources:
    2
    - Fixed the node parenting check.
    - Fixed checking for only ".blp" at the end of a texture path, and added a ".tga" check.
    - Added a check to see that a material layer references a valid texture.
    - Updated to the latest viewer code.
    - Changed the UI a bit.
     
  11. GhostWolf

    GhostWolf

    Joined:
    Jul 29, 2007
    Messages:
    4,836
    Resources:
    2
    Tools:
    1
    Tutorials:
    1
    Resources:
    2
    - Added reporting useless objects. Reports textures, texture animations, materials, geoset animations, and global sequences (anything I forgot?)
    - Added some more tests (e.g. all texture references in a layer's image animation are checked, and a couple of others).
    - Made the client more reliable, it no longer messes with internal models, causing the viewer to show unintended things.
    - The test results and console logs are now cleared every time a new test begins.

    /Edit
    - Sequences with unknown names are now reported as useless, rather than a warning.
     
    Last edited: Jul 9, 2017
  12. GhostWolf

    GhostWolf

    Joined:
    Jul 29, 2007
    Messages:
    4,836
    Resources:
    2
    Tools:
    1
    Tutorials:
    1
    Resources:
    2
    - Updated to the latest library code.
    - Improved the testing code, it should be far more stable.
    - Added a more stable reference counting code for all of the relevant objects. It works far better, however it doesn't contain the reason an object is considered useless. If the object has errors/warnings, that's probably the reason! If it doesn't, then the object is simply not referenced at all, and is just garbage (or if it's not supposed to be garbage, you forgot to use it!)
    - Added more tests and cleaned the existing ones.
    - The viewer now shows the model extent. This can help you determine if the extents are an issue for you or not. I am not 100% sure this is how extents work, so correct me if it's not (mostly the size and location).
     
  13. Alethos

    Alethos

    Joined:
    Jan 25, 2017
    Messages:
    207
    Resources:
    6
    Models:
    6
    Resources:
    6
    Hey this tool hasn't failed me before now... but I couldn't get Retera's MatrixEater to open a model so I tried to use the sanity tool to see what was amiss... and it doesn't do squat (won't even open it?). I haven't ever had problems with this model in game though.

    Any ideas?

    EDIT: This is the exception MatrixEater throws:

    Unknown error occurred:
    java.lang.IndexOutOfBoundsException: Index: 41, Size: 19
    at java.util.ArrayList.rangeCheck(Unknown Source)
    at java.util.ArrayList.get(Unknown Source)
    at com.hiveworkshop.wc3.mdl.Geoset.getMatrix(Geoset.java:243)
    at com.hiveworkshop.wc3.mdl.Geoset.updateToObjects(Geoset.java:429)
    at com.hiveworkshop.wc3.mdl.MDL.read(MDL.java:1112)
    at com.hiveworkshop.wc3.mdl.MDL.read(MDL.java:945)
    at com.hiveworkshop.wc3.gui.modeledit.ModelPanel.<init>(ModelPanel.java:51)
    at com.matrixeater.src.MainPanel.loadFile(MainPanel.java:2394)
    at com.matrixeater.src.MainPanel.loadFile(MainPanel.java:2427)
    .... and on and on
     
    Last edited: Jan 16, 2018
  14. GhostWolf

    GhostWolf

    Joined:
    Jul 29, 2007
    Messages:
    4,836
    Resources:
    2
    Tools:
    1
    Tutorials:
    1
    Resources:
    2
    That model somehow has two vertices that reference invalid matrix groups.
    Some kind of bad exporter?
    I added a test for this for both the sanity tester and the viewer itself, thanks!
     
  15. GhostWolf

    GhostWolf

    Joined:
    Jul 29, 2007
    Messages:
    4,836
    Resources:
    2
    Tools:
    1
    Tutorials:
    1
    Resources:
    2
    Changed the look a bit, added another test, and you can now drag and drop files into the page.
     
  16. GhostWolf

    GhostWolf

    Joined:
    Jul 29, 2007
    Messages:
    4,836
    Resources:
    2
    Tools:
    1
    Tutorials:
    1
    Resources:
    2
    Added another test, and fixed the extents in the viewer as far as I can tell. This should make it easy to see if the extents are wrong and need to be recalculated in Magos or some other tool.

    I removed the attachment name checking, because I cannot figure the exact rules.
     
    Last edited: Jan 22, 2018
  17. GhostWolf

    GhostWolf

    Joined:
    Jul 29, 2007
    Messages:
    4,836
    Resources:
    2
    Tools:
    1
    Tutorials:
    1
    Resources:
    2
    - Added a test for a geoset having too few or too many sequence extents. This doesn't seem to affect the game in any way, but it can make Magos behave badly.
    - Removed the file selection button, just drag your files into the page.
    - MDL files can now be loaded too.
    - The messages are now shown in the same hierarchy the model objects have, rather than a list. The color of the object names is determined whether they, or anything down the hierarchy, have any errors (red), or otherwise any warnings (yellow), or otherwise whether they are not used at all (green).
    - Added the [probably useless but fun] ability to view the MDL source of the objects in question. Click on the black "VIEW" button next to the object names. If you happen to notice anything wrong with the MDL source, I'd like to know so.
    - BLP testing coming soon-ishâ„¢.
     
    Last edited: Apr 7, 2018
  18. GhostWolf

    GhostWolf

    Joined:
    Jul 29, 2007
    Messages:
    4,836
    Resources:
    2
    Tools:
    1
    Tutorials:
    1
    Resources:
    2
    Added a beta BLP test.
    If you drop a model onto the page, you get the model test and view.
    If you drop a texture onto the page, you get the texture test and a simple 3D texture view.

    /Edit
    Added the full model structure, you can click on any part of it to show the MDL source.
     
    Last edited: Apr 7, 2018
  19. GhostWolf

    GhostWolf

    Joined:
    Jul 29, 2007
    Messages:
    4,836
    Resources:
    2
    Tools:
    1
    Tutorials:
    1
    Resources:
    2
    You can now load Hive attachments by directly grabbing and dropping their links on the page. This applies to thread and pastebin attachments.

    Added tooltip messages to some of the warnings, which you can see by the messages having a black dashed underline.
    Their purpose is to explain why the warning is showing.
    If it seems good, I'll improve them and add the rest.
     
  20. Austrulex

    Austrulex

    Joined:
    Jul 26, 2017
    Messages:
    57
    Resources:
    0
    Resources:
    0
    Hi, I wanted to know what causes the model I created which is attached to crash both the editor and the game and how would I go about and fixing so I tried the tester and when I dragged the model to it it shows nothing,
    Did I do something horribly wrong???
     

    Attached Files: