Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

MDL Exporter for Blender3D!

Discussion in 'Modeling & Animation' started by Fingolfin, Aug 26, 2018.

  1. burstman0

    burstman0

    Joined:
    Feb 21, 2019
    Messages:
    6
    Resources:
    0
    Resources:
    0
    thanks for this, sorry if this has been asked before, but can you make a mdl importer aswell ? i tried some mdl importers for models but none of them work and set properly as i want them to.
     
  2. Fingolfin

    Fingolfin

    Joined:
    Jan 11, 2009
    Messages:
    3,253
    Resources:
    154
    Models:
    144
    Icons:
    1
    Packs:
    4
    Skins:
    2
    Maps:
    1
    Spells:
    1
    Tutorials:
    1
    Resources:
    154
    I was thinking of doing that! There is one MDL importer on github that i personally use sometimes, but it only works for Blender 2.79. It would be nice to have one that imports with the same "rules" as the exporter, so that files can be imported and then re-exported without extra work.
     
  3. GhostWolf

    GhostWolf

    Joined:
    Jul 29, 2007
    Messages:
    4,952
    Resources:
    2
    Tools:
    1
    Tutorials:
    1
    Resources:
    2
    I just realized you asked a question and I never replied.

    1.5 years later, yes there models with animated helpers.

    Just as an example of when such a thing is needed, imagine if you want to have a mesh that moves in a circle around the model's center, but also rotates/scales around itself (afaik this is a pretty common effect?)

    I don't have the WC3 resources right now, but just opening the first arbitrary custom model I have in my pc with helpers gave me helpers with rotation animations.

    At the end of the day, the node tree in WC3 models isn't a skeleton, it's more akin to a scene.

    Did you figure out how to convert between the visual and numerical representations of tangents?
     
  4. Fingolfin

    Fingolfin

    Joined:
    Jan 11, 2009
    Messages:
    3,253
    Resources:
    154
    Models:
    144
    Icons:
    1
    Packs:
    4
    Skins:
    2
    Maps:
    1
    Spells:
    1
    Tutorials:
    1
    Resources:
    154
    @GhostWolf Haha thank you, i managed to figure it out though in the mean time! From my understanding, the difference between bones and helpers is simply that bones can have vertices skinned to them while helpers cannot.

    Unfortunately, i wasn't able to figure out the tangent issue, so the handle length has no effect.
     
  5. smithyjones

    smithyjones

    Joined:
    Jul 15, 2020
    Messages:
    10
    Resources:
    0
    Resources:
    0
    @Fingolfin I've been using your MDL Exporter to make my first Warcraft 3 model. It's been very helpful!

    I've been having trouble doing texture animations. I made a Mapping Node with the same name as the layer that I want to animate, and I've added some keyframes to the Location of the Mapping Node. My resulting .mdl file doesn't have a TextureAnims section, and there is no texture animation. I'm not sure where I went wrong. Can you attach a screenshot showing how to do it correctly?

    I'm using the 2.8.0 branch of your MDL exporter. I'm also using Blender 2.83

    EDIT: I did a bit of debugging myself by adding some logs to your script.

    EDIT 3: I made the logging a bit easier to read by removing some redundant lines. The code and log output have been editted for clarity

    I modified the get() function of your War3AnimationCurve() class to give some logs:
    I get log messages like this:

    It looks like the datapath has a "1" instead of "Location" in its key for whatever reason. I'm not too knowledgeable about the Blender API, so I'm not sure how to interpret this.

    EDIT 2: I've tried switching back to Blender 2.8.1 and installing the MDL Exporter there, but I get the same result with the same debug messages.

    EDIT 4: I have attached my .blend file so you can check everything yourself
     

    Attached Files:

    Last edited: Jul 16, 2020
  6. Fingolfin

    Fingolfin

    Joined:
    Jan 11, 2009
    Messages:
    3,253
    Resources:
    154
    Models:
    144
    Icons:
    1
    Packs:
    4
    Skins:
    2
    Maps:
    1
    Spells:
    1
    Tutorials:
    1
    Resources:
    154
    Thank you for your post, i know i had some issues with texture animations previously, there was a fix for this but i noticed that it didn't properly solve the problem. I will take a look at it in the upcoming days and see if i can work out a proper fix.
     
  7. burstman0

    burstman0

    Joined:
    Feb 21, 2019
    Messages:
    6
    Resources:
    0
    Resources:
    0
    how to set custom texture path ? we need a mpq ?
     
  8. Fingolfin

    Fingolfin

    Joined:
    Jan 11, 2009
    Messages:
    3,253
    Resources:
    154
    Models:
    144
    Icons:
    1
    Packs:
    4
    Skins:
    2
    Maps:
    1
    Spells:
    1
    Tutorials:
    1
    Resources:
    154
    You just type the path into the path field. When you import the model, import the texture with the same path as the one you used in Blender.

    To preview the texture on the model in Blender, you need to add an image texture node to the node tree and link it to a shader.
     
  9. burstman0

    burstman0

    Joined:
    Feb 21, 2019
    Messages:
    6
    Resources:
    0
    Resources:
    0
    Ok, thanks. Until now i have 2 issues with this exporter.
    The exported model its not facing front direction, but facing left angle, in blender my model it is facing front, perhaps viewport issues?
    Cant export animations right, they appear diferently when i preview them with magos, even with custom fps, my animations are fast and dont have long keyframes, thats maybe the problem?
     
  10. sonphamthe11H

    sonphamthe11H

    Joined:
    Mar 6, 2017
    Messages:
    157
    Resources:
    0
    Resources:
    0
    this is the "front" in blender, u might want to rotate it by -90 degree
    upload_2020-9-1_10-32-19.png
     
    Last edited: Sep 1, 2020
  11. burstman0

    burstman0

    Joined:
    Feb 21, 2019
    Messages:
    6
    Resources:
    0
    Resources:
    0
    Yea, just noticed that, front views are different from blender to warcraft.
    Its not a good idea just rotate it, because my animation is following y axis, so if i do it will not be the same as i want.
    Still the problem not fixed even if i change the view to right, still exporting wrong, left angle.
    Screenshot
    Screenshot
     
    Last edited: Sep 1, 2020
  12. sonphamthe11H

    sonphamthe11H

    Joined:
    Mar 6, 2017
    Messages:
    157
    Resources:
    0
    Resources:
    0
    blender 2.90 released, any plan to update?
     
  13. Fingolfin

    Fingolfin

    Joined:
    Jan 11, 2009
    Messages:
    3,253
    Resources:
    154
    Models:
    144
    Icons:
    1
    Packs:
    4
    Skins:
    2
    Maps:
    1
    Spells:
    1
    Tutorials:
    1
    Resources:
    154
    Does it not work in 2.9?
     
  14. dtnmang

    dtnmang

    Joined:
    Apr 20, 2010
    Messages:
    561
    Resources:
    12
    Models:
    5
    Maps:
    2
    Ported Models:
    1
    Tutorials:
    4
    Resources:
    12
    This plugin cannot export Reforged HD models yet, or can it?
     
  15. Fingolfin

    Fingolfin

    Joined:
    Jan 11, 2009
    Messages:
    3,253
    Resources:
    154
    Models:
    144
    Icons:
    1
    Packs:
    4
    Skins:
    2
    Maps:
    1
    Spells:
    1
    Tutorials:
    1
    Resources:
    154
  16. randymod

    randymod

    Joined:
    Oct 26, 2020
    Messages:
    1
    Resources:
    0
    Resources:
    0
    It worked well for me,but I have a little problem about the bone's order,I tried Neodex 2.7,it always read the first bone from rootbone,and read the parent bones before the children bones,is it possible to do this in blender?
     
  17. Fingolfin

    Fingolfin

    Joined:
    Jan 11, 2009
    Messages:
    3,253
    Resources:
    154
    Models:
    144
    Icons:
    1
    Packs:
    4
    Skins:
    2
    Maps:
    1
    Spells:
    1
    Tutorials:
    1
    Resources:
    154
    What technical significance does bone order have in the file?
     
  18. Razorclaw_X

    Razorclaw_X

    Joined:
    Apr 12, 2018
    Messages:
    362
    Resources:
    3
    Ported Models:
    3
    Resources:
    3
    I suppose technically nothing, but it is kind of a pain when reading it in textpad when none of the bones are in any consistent order.

    Since no tool is perfect sometimes copy/pasting bone information manually has to happen and a lot of the time with this exporter it boils down to Ctrl-F the bone names.
     
  19. Fingolfin

    Fingolfin

    Joined:
    Jan 11, 2009
    Messages:
    3,253
    Resources:
    154
    Models:
    144
    Icons:
    1
    Packs:
    4
    Skins:
    2
    Maps:
    1
    Spells:
    1
    Tutorials:
    1
    Resources:
    154
    I understand, currently i think they are written from a hashtable which results in a random order.. maybe i can put them in a list sorted by name before writing them to file.
     
  20. sonphamthe11H

    sonphamthe11H

    Joined:
    Mar 6, 2017
    Messages:
    157
    Resources:
    0
    Resources:
    0
    @Fingolfin my model lost smooth group when export
     

    Attached Files: