• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Exporting models from Blender using the MDL exporter plugin

Level 5
Joined
Oct 29, 2017
Messages
69
I would appreciate help with exporting an animation. Exporting mesh works fine.

Here I have a cube. It has bone "main". I animated it to scale. Enlarge on "Birth", stay still on "Stand" and shrink on "Death". Those are marked in Blender. In resulting *.mdl there are no keyframes. Previous attempts yielded something, however distorted.
+
Scaling is the specific feature I need to work for my actual model.
 

Attachments

  • untitled.mdl
    3.7 KB · Views: 128
  • untitled.blend
    494.5 KB · Views: 154
Last edited:
The problem is that you have animated the armature, and not the bone itself. The armature is just a container for a set of bones - right now, the exporter doesn't support animating the armature itself, but this is being added soon.

To fix this, press your armature and enter "Pose Mode". Select the main bone and animate it in the same way as you did before. Also remove your old animation. If you only need a single bone though, it can be easier to just replace the armature with an empty object with a name which starts with "Bone_", and parent the mesh to it.
 
Level 5
Joined
Oct 29, 2017
Messages
69
Alright, I think it worked now. Thank you.

Just a few more questions, if you will.

I think animating distorted the mesh in the resulting MDL. What is the best way to bypass that? Namely, the mesh or the object in the MDL is the scale of the first frame of the Birth animation. Which is tiny. If I just make the first frame different, will that change the outcome?

Another question. How does it map Blender timeline to WC3 one? For example, I need to ensure that Birth and Death animations take exactly 1 second, which is 1000 frames normally in MDL.
 
Yes - the first frame is used as the "reference pose", i.e. it becomes the neutral state of your model. I really should make it so that it somehow inverse transforms all animations used in this frame, but it is easier said than done. It is easy to fix this though by just adding a frame with the scale of 1 at frame 1, and moving the start of your birth animation to another frame. Overall, whenever you want to animate something, make sure to add a keyframe to frame 1 first so as to preserve your reference pose. I should probably make a tutorial on how to animate with this tool.

The number of frames per second in the timeline can be set manually in the render tab of the properties menu, under "Dimensions". It defaults to 24fps, but you can set whatever value you want there.
 
Level 5
Joined
Oct 29, 2017
Messages
69
How does the fact that bones have their own direction influence the animation? It seems to me that it conflicts with how WarCraft 3 does it. For example, I need to make sure that bones "up" is Z axis to make sure that scaling mesh works properly. Unfortunately it skews billboarding. That is, I need to rotate objects to compensate for the rotated bones. Am I doing something wrong?
 
Level 5
Joined
Oct 29, 2017
Messages
69
When I scaled bone in Blender, it scaled along the Z axis of the world and along the Y axis of the bone itself. However, in War3ME it just scaled along Y axis. That is, instead of scaling up and down it scaled sideways. If I interchanged the modification in Blender, the result in War3ME would change accordingly.

I encountered people having similar problems with exporting to Unity. Their answer was to rotate the bones.

I no longer have the model in question, that exact version anyway. If I will reliably reproduce the issue, I will share it here.
+
As to billboards I have the same issue that was already discussed in this thread. I will figure it out.
 
Level 1
Joined
Jul 20, 2019
Messages
1
Good day and thanks for creating a great tool.
I've only one little problem with this addon.
it seems to produce double vertex for each triangle/face the vertex relates to.
Which enlarge an overall filesize of a model.
Is there any way to fix that?
I currently merge double vertexes in Mdlvis manually.
 
This is because you are exporting with flat shading. Set shading to "smooth" and the vertices will be merged. You can also turn on "auto smooth" to get hard edges in appropriate places. Note though that hard edges are achieved by splitting the normals, so by definition this will duplicate the vertices along those edges.

Suzanne.PNG

In other news, i added a new way of exporting vertex color. The regular workflow is to change or animate the "object color" field to get a vertex color "tint", but now you can also add vertex color per material by adding a node called "VertexColor" to the graph. The exporter will use the color from the node's first input socket, so the node needs to have a color there, otherwise you will probably get an error. Examples of nodes you can use include Emissive BSDF, Diffuse BSDF, Mix Color - anything which has a color input. Now that i think of it, i should probably change it so that you'd use an RGB input node instead, for less ambiguity... maybe i'll do that in the future. Also: this feature is somewhat hackishly implemented and will not work if the mesh has multiple material slots. It uses the active material slot of the object.
 
Last edited:
Level 2
Joined
Dec 17, 2016
Messages
6
Hi.I'm have problem.How i'm can fix it.Thank you
 

Attachments

  • Blender User Preferences 2019-07-26 19.40.12.png
    Blender User Preferences 2019-07-26 19.40.12.png
    65.1 KB · Views: 227
Level 7
Joined
Sep 16, 2016
Messages
184
Hey, recently I got Blender 2.8 with Cats blender plugin (instead of MMD Tools) to convert mmd->wc3. I tried exporting the mmd with your plugin but it gave me a traceback error. (https://i.imgur.com/94Nqga7.png). I can see the path is c://... however I installed Blender in A://... Could this be the problem?

edit: Reinstalled everything, the paths matches now but still same error. Should I go back to 2.79?

edit2: Went back to 2.79. Everything works fine.
 
Last edited:
It doesn't matter what drive you install Blender to, the directory path you're seeing is for the AppData folder, a hidden folder which contains the internal files for all your programs. It is located on the same drive as your operating system.

Either way, this is fixed now! Thanks for letting me know!

Also, i thought i'd share one of my .blend files so that beginners can use it for reference. It contains most of the usual stuff, like portrait glow, sound events, footsteps, attachment points, and animations. It is rigged using the empty object approach rather than using an armature. I hope someone finds it useful!
 

Attachments

  • BMP3.blend
    3 MB · Views: 220
  • PattonTreads.tga
    16 KB · Views: 194
  • BMP3.tga
    256 KB · Views: 199
  • BMP3.blp
    64.6 KB · Views: 195
  • PattonTreads.blp
    11.8 KB · Views: 191
Level 7
Joined
Sep 16, 2016
Messages
184
Awesome. By the way, I forgot to mention I can't use the program anymore due to the fact it only converts one geoset and not every single one. Is this something you know of?
 
Level 1
Joined
Nov 27, 2015
Messages
2
I'm having problems enabling the export plugin in blender, it gives me this error when I try

edit: seems like everyone was having problem with 2.8 branch so I switched back to 2.79 and it's working
 

Attachments

  • upload_2019-9-23_8-1-53.png
    upload_2019-9-23_8-1-53.png
    126.5 KB · Views: 192
Last edited:
Level 5
Joined
Mar 6, 2017
Messages
190
@Fingolfin idk if this possible or not
I have made many models back when I was still using 3ds max
The question is,is it possible to import the keyed note in the original file to the blender’s one?
 
Level 6
Joined
Jan 3, 2020
Messages
65
Some models, such as the Water Elemental, use texture animations to make it seem as if the water is moving across its body. The exporter allows you to make texture animations by adding a Mapping node to the node graph, naming it the same as your layer, and then animating its values. This way you can preview the animation by feeding it into the texture slot of your actual material (MDL materials are just data containers and won't affect how the mesh is rendered in blender). To edit the shader graph, open the graph editor in a window (hotkey: Shift+F3) and press the button which says "Use Nodes" in the material panel. You can create nodes by pressing Shift+A. You can rename nodes by selecting them and typing in a name in the panel to the left of the graph viewport.

Could you post screenshots on that specific step, or provide a .blend file of one model with that setup please ?
I have a mapping node with keyframes to get a scrolling texture, I renamed it with the same name as the mdl-material layer, but the export seem to ignore this. The animation (sequence) is exported correctly though. I renamed the mapping node in the Shader Editor (both it's « Name » and its « Label »), as I could not rename it in the Graph Editor (I guess that's what you were refering to when you said "graph viewport"). In the Graph Editor I can only rename the mesh object and the material, I can't rename « Shader Nodetree ».
I can provide you with my .blend file or the .mdl if you want to give it a look.

I did it in War3 Model Editor considering it manages Texture Animations, Global Sequences, and all that pretty well, but it doesn't save the Texture Animation to a Material (everytime I reopen the file the Material isn't link anymore to the Texture Animation). Maybe you know a sofware who can edit those things (tried Retera Model Studio and Mdlvis) ?
 
Level 6
Joined
Jan 3, 2020
Messages
65
Yeah, thanks, I just did it and it works.
But I still have to create/write the Global Sequence, Texture Animation & stuff myself, while apparently the MDL-exporter has a functionality to do that itself, so I'm still interested in knowing how to setup that in Blender.
 
Level 6
Joined
Jan 3, 2020
Messages
65
Oh my !
Works perfectly with 2.8, the new mapping node of 2.82 isn't recognised by your addon (2.8 only partially recognise it : values are kept, but ignore the node when running the animation).
I should have thought of it myself, sorry for bothering you.
 
Level 3
Joined
Jan 30, 2020
Messages
46
Does this tool work with the latest version of the editor? Is there anything specifically I need to do with the models so they appear correctly in the game?
 
Level 3
Joined
Jan 30, 2020
Messages
46
It should. If you are using custom textures, you need to make sure that their import path matchens what you've set in the MDL layer of the material.

If you are having issues feel free to send me the model and I can have a look at it.

I'm having issues installing the plugin. I have the latest blender, I extract the export mdl file and add it as a zip then select it in blender and nothing happens. I receive no error message and it's not listed in my addons list.
 
I'm afraid the .mdl in blender, it's not the same as in Warcraft 3.

There used to be one for Quake .mdl models, but it is gone in 2.8. The one in this thread is obviously for warcraft though.

I'm having issues installing the plugin. I have the latest blender, I extract the export mdl file and add it as a zip then select it in blender and nothing happens. I receive no error message and it's not listed in my addons list.

After downloading the github project and unzipping it, you should have a folder called MDLExporter. Inside is another folder called mdl_exporter, one called images, a license file and a readme file. You want to take the file called mdl_exporter and add that to a zip (right click>send to>compressed folder). The resulting zip file is what you select when installing the addon (also try searching for "mdl" in the addon search window). You might need to restart blender before it appears in the list. If it still doesn't work, try installing blender 2.8 instead of the most recent 2.82.
 
Level 3
Joined
Jan 30, 2020
Messages
46
There used to be one for Quake .mdl models, but it is gone in 2.8. The one in this thread is obviously for warcraft though.



After downloading the github project and unzipping it, you should have a folder called MDLExporter. Inside is another folder called mdl_exporter, one called images, a license file and a readme file. You want to take the file called mdl_exporter and add that to a zip (right click>send to>compressed folder). The resulting zip file is what you select when installing the addon (also try searching for "mdl" in the addon search window). You might need to restart blender before it appears in the list. If it still doesn't work, try installing blender 2.8 instead of the most recent 2.82.

The file is called export_mdl not mdl_exporter and I tried that already and nothing happens. By nothing I mean nothing. I add it and the dialog disappears back top the screen where I select preferences.
 
Level 1
Joined
Apr 8, 2020
Messages
1
Hi, I know that more than 2 years have passed, but I have a problem with exporting animations.
I added two animations to my model. However, after loading the model in mdlvs I found that my animations were gone. In addition, the model took the initial pose from the second animation. I saw the same picture in the game itself. I tried to create animations in different ways, but still nothing worked. Can you help me? Could there be a problem because I use Blender version 2.79 or because of that I use Warcraft version 1.26.
Can you make a video tutorial or guide about creating and exporting animations? It will help everyone!
Sorry for my bad english and russian text on screenshots
In any case, many thanks for your plugin, this is the best I could find.
 

Attachments

  • 2.png
    2.png
    40.3 KB · Views: 120
  • 3.png
    3.png
    3.6 MB · Views: 155
  • exported.mdl
    193.4 KB · Views: 50
  • my_model.blend
    718.4 KB · Views: 58
Level 1
Joined
Mar 31, 2020
Messages
2
Fingolfin » Thank you for your amazing work with plugin for blender. In 3D modeling i am just newbie, but i want to ask about animations. It's better for units, buidings, tree to make your own animation in blender and then export to mdl file or use War3 Model Editor and import new model to old original.

I ripped some models from reforged and transform them for old warcraft 3 without animation of course. Thanks for your answer.
 
@Fingolfin could u add tutorial for effect editing?

I recommend that you look at some of WILL THE ALLMIGHTY's tutorials, like this one. Even though it's for a different editor, the names are still exactly the same in the Blender plugin. You just create a plane, add a particle emitter to it, and then edit the values in the MDL Particle System dropdown. To animate fields, just mouse over them and press I, and it will add a keyframe for this value at the current position in the animation timeline. There are some presets available that you can look at for reference.

Fingolfin » Thank you for your amazing work with plugin for blender. In 3D modeling i am just newbie, but i want to ask about animations. It's better for units, buidings, tree to make your own animation in blender and then export to mdl file or use War3 Model Editor and import new model to old original.

I ripped some models from reforged and transform them for old warcraft 3 without animation of course. Thanks for your answer.

I'd say it's easier to make new animations (building animations are usually pretty simple), but that of course takes time and requires some skill. If you want to transfer animations from another building, then you need to create bones with the same names as in the model with the animations (and preferably in the same positions), and then after exporting you can use a tool such as Oinkerwinkle's Animation Transfer to transfer over the animations. It's a "hit or miss" approach though, animations were made to fit their model and sometimes they won't look as good on others.
 
Hi, I know that more than 2 years have passed, but I have a problem with exporting animations.
I added two animations to my model. However, after loading the model in mdlvs I found that my animations were gone. In addition, the model took the initial pose from the second animation. I saw the same picture in the game itself. I tried to create animations in different ways, but still nothing worked. Can you help me? Could there be a problem because I use Blender version 2.79 or because of that I use Warcraft version 1.26.
Can you make a video tutorial or guide about creating and exporting animations? It will help everyone!
Sorry for my bad english and russian text on screenshots
In any case, many thanks for your plugin, this is the best I could find.

Hey man, sorry for the late response! The problem with your model is that the pose on the first frame is used as the rest pose. Ideally, the exporter would extract the rest pose from the armature, but i haven't figured out how to do that yet, so currently it uses frame 0. Whenever you start animating a model, make sure that you add keyframes for rotation, location, and scale on frame 1 (or frame 0) before you start. You also need to add timeline markers to denote your animations. I'm attaching a fixed version of the model to this post.


It's Greyed out and I can't enable it.

It works for me with 2.91. Make sure that you are downloading the correct branch from github and that you have zipped it like it says in the instructions.
 

Attachments

  • my_model.blend
    784.6 KB · Views: 54
  • my_model.mdl
    184.5 KB · Views: 43
What i am doing wrong? Latest Blender (even with 2.80 blender cause same issuue)
pXfCMpsM5D0.jpg

This appear when i try export model with an animation from BFME (attached video). Some animations exported fine, but now i am started to see this error. Anyone know what is this and might be it can be fixed?

 

Attachments

  • Blender Error.jpg
    Blender Error.jpg
    45 KB · Views: 49
Top