• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Blender 2.57 static mesh exporter (robust)

Status
Not open for further replies.
Level 3
Joined
Dec 30, 2007
Messages
48
File is as a attachment. What it can do?

1) Export static mesh
2) Export texture

What it does not do?

1) Everything else

This is base for future development.

EDIT 02.07.2011 START
Warcraft 3 wants texture to be flipped vertically to display correctly in Warcraft 3 Viewer. When I get time and know-how I make script automatically flip UV coordinates for Warcraft engine. I notify when it is done.
EDIT 02.07.2011 END

attachment.php


HOW-TO: Fire up Blender 2.57, load your mesh (give it a texture, might be optional, do not use procedural stuff). Go to 'Edit Mode', from 'Edit Mode' header press 'Mesh'. Pop-up window jumps up, choose 'Faces' > 'Quads to Tris'.
Go to Text Editor, press Text > Open and open blend2war3mdl.py. Make sure your mesh is selected and press 'Run Script'.

First of all change *.txt to *.py ending, though you can load it as txt file also I think. Forum did not allow *.py extension.

Generated file will be saved on "C:\BLENDER_MDL.txt"

From there you should know how to convert onwards. Python is pretty simple so change filepath where it will be saved if you want.

I have jassing background and managed to end up with such script, if you take time and try to understand (it is pretty easy) you can contribute yourself too.

Do not expect too much of it, all hate and praise welcomed.
 

Attachments

  • blend2war3mdlSplash.jpg
    blend2war3mdlSplash.jpg
    26.6 KB · Views: 1,338
  • blend2war3mdl.txt
    7.2 KB · Views: 349
Last edited:
Level 6
Joined
Jan 31, 2009
Messages
166
I attempted to use this after following all the steps given (I think). I simply attempted to export the default cube after converting it to tries and giving it a texture. It gave me an error at line 30. Could you possibly post an example .blend? (with the script set up and a simple mesh ready to be exported)

(Sorry if this is considered necroposting but I am very interested in a blender exporter for wc3)
 
Level 3
Joined
Dec 30, 2007
Messages
48
This is not a necropost, glad someone replyed. Which Blender version do you use? Which operating system do you use?

I tried this script on Win 7 Blender 2.58 (latest, came out july 2011, update your version) and started Blender as Administrator (right click on Bledner icon and choose 'Run as Administrator'). "Exported" file will be created on your C:\Blender_MDL.txt

If you have no administrator rights Blender complains can't write file (or open file to write) Blender_MDL.txt.
Write back how your test went.

To be specific Buggy-UV-5.blend is a Blender 2.58 file:
attachment.php
 

Attachments

  • Buggy-UV-5.blend
    494.4 KB · Views: 169
  • BuggyFlipCheck.mdx
    20.9 KB · Views: 168
  • BuggyFlip.blp
    385.3 KB · Views: 174
  • BuggyFlipCheck.mdl
    66.3 KB · Views: 143
  • BuggyFlip.jpg
    BuggyFlip.jpg
    71 KB · Views: 190
  • Buggy-Rdy.jpg
    Buggy-Rdy.jpg
    14.2 KB · Views: 1,064
Level 6
Joined
Jan 31, 2009
Messages
166
I tried to run it in 2.57b and in 2.58 on XP with administrator privileges. However it always got stuck on like 30. I was able to export the buggy from your blend file without issue and see it in both the wc3 model editor and in game (although the scale was tiny). I think I might have been doing the texture wrong or something.
 
Level 3
Joined
Dec 30, 2007
Messages
48
Glad to hear you got my demo file working. I might add do not try to use something super-advanced in Blender, if it is in the end mesh with image texture it should be exportable. Use advanced options, but before exporting reduce it to really basic form.
With latest Blender (2.58 or any) you can't go really wrong with adding texture. If you want you could post your faulty blend file and maybe (really maybe, I am no expert at this field) I might spot what was wrong.
To share some info, how I wrote this code, exporting UV coordinates is not optimized. Currently it converts face UV coordinates to sticky UV coordinates at 1:1 scale. This adds 2x (or even 3x) vertices count and additional faces to model. (Though in Blender there is way to choose between sticky UVs and face UVs, I do not know how exactly. I mean it is default vanilla Blender UV texture editor option [just activate it and vertices count remains optimized]).
It is not perfect, but does the job and opens new possibilities to model free (tm) XD
 
Status
Not open for further replies.
Top