Modcraft - The community dedicated to quality WoW modding!
Wrath of the Lich King Modding => Resources and Tools => Topic started by: happyhack on March 26, 2014, 01:38:54 pm
-
plop,
i looked around a bit and it seems theres no proper import/export WMO script for blender 2.5+
Well there was an old script for 2.4x but this version is pretty old now and it didnt support export anyway.
So i started one
(http://imageshack.com/a/img33/9517/glkp.png)
can just import materials and geometry for now.
edit : Updated
problems facing :
- Since blender doesnt support texture format plugin, textures have to be png files and be in wmo's directory for them to display correctly
- M2 doodads inside wmo gonna be the hard part, I still dont know how to get this work.
/! Should work for 2.5+ but only tested under 2.7
Feel free to help, just tell me so we can organize
https://www.dropbox.com/s/62k5rul2mj7o3 ... n.rar?dl=1 (https://www.dropbox.com/s/62k5rul2mj7o3pk/blender%202.7%20wmo%20plugin.rar?dl=1" onclick="window.open(this.href);return false;)
Informations
Options related to wmo are given through custom panels in the properties window. Each has the name "Wow <something>" and can be enabled or disabled.
There is currently 4 panels available.
(http://imageshack.com/a/img62/180/ioum.png)
Wow WMO group panel is in Object properties, it shows options relative to wmo groups.
Group name/desc are optionnal and are just referenced from inside wmo, seems to have no effect.
This panel MUST be enabled when exporting, else export will fail.
Wow material panel is in Material properties, it shows options relative to wmo shader. The only options that are exported are shown in this panel (blender materials / texture are not exported)
Materials are displayed on faces assigned to this material.
If the panel is disabled, the material is not exported and assigned faces will not be visible in game (it can still collide though)
Wow collision panel is in Data properties and are only visible when selecting a mesh. It shows options relative to wmo collisions. "collision vertex group" specifies the vertex group whose faces will be allowed to collide.
Wow light panel is in Data properties and are only visible when selecting a lamp. It shows options relative to wmo lights. This panel will probably change later.
Lights are not exported for now.
UV
Only the active UV layer is exported. UV data imported are stored in "UVmap" layer.
Vertex color
Only the active Vertex Color layer is exported. Vertex color data imported are stored in "Col" layer.
-
Dude, I'll test it right now! Awesome. Check PM please.
-
Absolutely amazing. I was just thinking about converting some wmo's to objs and making a login screen with models. This will make my life much easier :)
[Edit]: Sorry first edit was wrong, it does work in 2.5 I fixed it. it should work with versions in between that and 2.7 I would think.
Again great job.
-
Does the export function exports working models? I mean can they be used in the game?
-
Nop, export doesnt work, there is yet some things to do before working on export (importing liquids, lights, collision meshes, and doodads)
-
Added light and liquid import, vertex color now work correctly.
But hey WTF lights are not even used in game? :shock: seems its only done through vertex color, m2 lights and dbc lights.
-
*As I understood this script didn't open root_wmo for now. It only imports groups files? Because if I try to import root.wmo nothing happends( and no errors).*Write this when testing the first version. With last version everything is all right*
BTW excellent work, dude. Will test all the updates and of course wait for the export function. Also I think that doodads for now not one of the important feature. Can't wait for implementing of collision meshes and portals between group files.
Also nice update on liquids. BTW it works not fine. It seems that liquid is parsed using only extreme values.
Here are some pics to show what I mean:
[attachment=1:17c5o2m4]water1.jpg[/attachment:17c5o2m4]
[attachment=0:17c5o2m4]water2.jpg[/attachment:17c5o2m4]
-
Domt care aboit m2. That is the job for an extra rool.
-
BTW it works not fine
yea... i know :S Im trying to find a way to manage these data. Theres no point in importing it as a mesh if i cant export it properly. Import is easy, but i dont know how the hell i gonna export liquids. Blender has no way to force an object to stay a grid, and... pffff... seriously dont know...
I though about projecting a grid from above and exporting coordinates like that but it wont be accurate, what if liquids on differents WMO have to match exactly (like the ones in stormwind)... guess its the best way to go though
Domt care aboit m2. That is the job for an extra rool.
hmmm... u mean importing and editing? sure i wont make an importer... But im tired to see 36 differents tools to do the same job. When exporting the WMO must be FULLY working. So i have to find a way to position and define doodads inside WMO. Gonna do it with empties i guess, will be easier than liquids :P
-
But you can have more then one set of them. Also m2s are just references and help to letnthe wmos size stay small. If you import them all the geometry is within your wmo. Also ifnyou have stuff like banner m2 andnyounchange them. Original all m2 references in your wmo also change. There is a tool started by cromon to edit wmo sets.
-
I think you shoud not make the doodadset import function. You just have to somehow preserve this data to get it converted back. You also should keep all the sections to make exported WMOs working in Cromon's editor. Anyway, this plugin is awesome.
-
I hate to be contrarian here, but I would love to see fully working doodad import. Just implement it as an option that’s turned off by default.
The feature isn’t very useful for WoW modding, but it’s excellent for doing fully rendered machinima, cutscenes, etc in Blender.
-
If this feature will exist the plugin will be very very inconvinient for WoW modding because the model will be full of useless doodad placeholders. And it will be nearly impossible to combine both .m2 and .wmo file formats in the one plugin. So, don't expect much. Machinima Studio can render fully working .wmos along with a doodadsets. We're not a machinima community and the goal is development. Sorry for a bit rude post, but I'm in a bad mood today. ;)
However, the plugin should preserve all these sections or create the new ones if they're missing to make Cromon's WMO doodadset editor compatible with exported models.
-
If blender support layers. You could create a layer for every doodadset and import the m2 in there.
Then name them with full mpq path if possible.
Now people could move them around. Dont knkw how to handle size.
During export you fetch the layers by name and create again the sets, calculate the doodad positon and add them to set. Then an import m2 funtion added and it is perfect. We can then even add another doodad group by addin a new layer with correct name. And machinima guys have full model.
-
If this feature will exist the plugin will be very very inconvinient for WoW modding because the model will be full of useless doodad placeholders.
Select => by type => empty => H key.
Is it that annoying really? :roll:
Then thats up to u if u want to keep them or not, but people (like me...) may want to at least, preserve doodads during import => export
If blender support layers. You could create a layer for every doodadset and import the m2 in there.
Then name them with full mpq path if possible.
Now people could move them around. Dont knkw how to handle size.
During export you fetch the layers by name and create again the sets, calculate the doodad positon and add them to set. Then an import m2 funtion added and it is perfect. We can then even add another doodad group by addin a new layer with correct name. And machinima guys have full model.
yep thats it, but im thinking of groups instead of layers. U could even import m2 models, hide them in an other layer, but still make the empties display the m2 at their position, so u can rotate and position doodads perfectly, then export them.
Just need an m2 import script, but if i remember correctly, there is already one somewhere...
anyway I added basic export. Does support geometry and materials. Doesnt export collision. I also removed liquid import for now...
Seems to work correctly.
/! - Mesh must be triangulated before export
- Vertices must have only 1 uv coordinate, else the result is unpredictable :? if u have to deal with seams just separate mesh parts in 3d view
(http://imagizer.imageshack.us/a/img20/4554/ukrm.jpg)
-
If this feature will exist the plugin will be very very inconvinient for WoW modding because the model will be full of useless doodad placeholders. And it will be nearly impossible to combine both .m2 and .wmo file formats in the one plugin. So, don't expect much. Machinima Studio can render fully working .wmos along with a doodadsets. We're not a machinima community and the goal is development. Sorry for a bit rude post, but I'm in a bad mood today. ;)
However, the plugin should preserve all these sections or create the new ones if they're missing to make Cromon's WMO doodadset editor compatible with exported models.
That’s why I suggested that it be an option that’s turned off by default (blender import plugins can present import options boxes prior to importing). There’s no need for software to be rigid and inflexible when options are easy to implement.
-
Awesome progress! Give the purple nickname to this guy! :D
-
Great progress. Hope you release soon a version with collision. I creat models from scratch, so export is much more importand for me :)
-
Added collision. Im not 100% sure what kind of algorithm blizzard use, but it seems to work. Tell me if u find any bug.
Collision panel is in Propertie view => Data
If some faces use a material which has Wow material panel disabled, its exported without material and therefore wont be rendered. If u have to export simplified mesh, do it this way.
-
Awesome update. Big thanks from all the Skarn project. Keep it on, dude. ;)
@Admins: I really think this guy should have a purple nickname. His contribution is really important for the scene.
-
Can't test it, how you're supposed to install that plugin ? I don't know shit about Blender.
Anyway if you can make it work properly ( = with portals and 100% working BSP tree), you'll definetely save us all from the available shitty tools. Mail me if you want some help with the trees or w/e, but seeing the source I guess you got them quite correctly.
-
Having an error:
[attachment=0:3i655f1y]error.jpg[/attachment:3i655f1y]
Changed the path for BSP_DEBUG.txt in BSP_Tree.py and export is worked.
-
I realize implementing bsp tree and collision in python is madness but well... got no choice. So it can be a bit long, and even make blender crash because of recursivity limit so be carefull when playin with node max size. From my tests i found 150 was a good limit but if u wanna change it u can
Having an error
thx for feedback, fixed it, as well as various other errors
Can't test it, how you're supposed to install that plugin ?
just copy io_scene_wmo to C:Program FilesBlender FoundationBlender<blender version>scriptsaddons
-
How many group files can we import with this script? It seems that we can't load big wmo's such as stormwind, undercity and etc.
Also when I imported pirate ship, delete the sails and export, game freezes when I look at this wmo.
-
How many group files can we import with this script? It seems that we can't load big wmo's such as stormwind, undercity and etc.
it works here :
(http://imageshack.com/a/img59/6196/khk2.png)
it has something like 1M triangles and 600+ lights. It can be long to load...
Also when I imported pirate ship, delete the sails and export, game freezes when I look at this wmo.
portals doesnt work. When u import something there is a panel in Object properties which gives informations about "indoor"/"outdoor". If u set everything to outdoor u can export without portal, else it will crash. Can be many other reason, like bsp bug, and other things... I didnt try bsp export on big object, but it will probably crash with default parameters, resulting in the exported wmo being corrupted.
-
Good software well use to import large piece of WMO (as h2 inn dala).
But I testing in game I have no collisions with.
Why? Should we make a special handling?
-
Seems many people have problems to know where panels are located so I updated first post with more informations.
-
(http://i.imgur.com/rGSIE8m.png?1)
I have this bug to export wmo.
Why ?
-
Hi, i have problem. I installing the script with Blender 2.62, i try import WMO i have error
the error : (http://puu.sh/8a3TQ.png)
-
I have this bug to export wmo.
Why ?
because i wrote 'h' instead of 'H'... updated
Hi, i have problem. I installing the script with Blender 2.62, i try import WMO i have error
what the hell did u do? u broke everything u bad boy
-
I get this error when importing! Am I doing something wrong?
Traceback (most recent call last):
File "C:Program FilesBlender FoundationBlender2.70scriptsaddonsio_scene_wmo__init__.py", line 65, in execute
import_wmo.read(self.filepath)
File "C:Program FilesBlender FoundationBlender2.70scriptsaddonsio_scene_wmoimport_wmo.py", line 51, in read
group.Read(f)
File "C:Program FilesBlender FoundationBlender2.70scriptsaddonsio_scene_wmowmo_group.py", line 71, in Read
self.mobr.Read(f)
File "C:Program FilesBlender FoundationBlender2.70scriptsaddonsio_scene_wmowmo_format.py", line 1125, in Read
self.Header.Read(f)
File "C:Program FilesBlender FoundationBlender2.70scriptsaddonsio_scene_wmowmo_format.py", line 17, in Read
self.Magic = f.read(4)[0:4].decode('ascii')
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd7 in position 0: ordinal not in range(128)
location: <unknown location>:-1
-
Thank you for this tool happyhack.
My custom wmos works fine with collision and everything but the script ignores lights/vertex color when exporting.
Any way to add lights to my custom wmos without using m2 light models?
-
Thank you for this tool happyhack.
My custom wmos works fine with collision and everything but the script ignores lights/vertex color when exporting.
Any way to add lights to my custom wmos without using m2 light models?
If I recall correctly, there is currently no way to add lights to custom WMOs.
-
You could always do it with M2 lights instead of vertex lighting.
-
Right now I'm trying to add m2 lights as doodads to wmos because they are very buggy for indoors if are added with Noggit or as gameobject.
The problem is that I don't know how to add doodads to custom wmos.
-
having this error, not reading path to .wmo or what?
(http://i.imgur.com/AzqbFu6.jpg?1)
http://imgur.com/AzqbFu6 (http://imgur.com/AzqbFu6" onclick="window.open(this.href);return false;)
-
As it says: that path does not point to a file.
-
EDIT: Happyhack told me to put all bloodelf_smallhouse02_xxx.wmo-s in the same folder that was my problem.
Altho it didnt open it at first cos I was using some 2.62 blender version for it, tried with newest v71 and it opened. yay :!: :!: !
-
tho got a new problem now, is there any way for it to export one single WMO with geosets? becuase if I check each box 'wow WMO group' on each layer it just pops out smallhouse_00 smallhouse_01 smallhouse_02 etc. If its unchecked it gives an error tho, just wondering if theres some way cos I would need that 1 wmo to swap it ingame
-
Latest error:
UnicodeDecodeError: `ascii` codec can't decode byte 0xa3 in position 0: ordinal not in range(128)
Problem only occurs in newer map regions, such as "Stormwind Trade District" or anything from Draenor.
-
I am also having some errors.
(http://i.snag.gy/wMRPn.jpg)
Okay, further testing shows that this seems to be happening with cata+ wmos so far. I've been able to get a few older ones working.
Notably, old stormwind and orgrimmar load easily enough, but the later versions have the error with the struct reading the wrong number of bytes.
Also, it seems to require 2.7, not 2.5. Not a problem but figured I should mention it =P
-
This script does not work well with Cata+ WMOs.
Is there any chance of it being updated to import the new WMO structure? I would appreciate it immensely. 010 editing WMO group files to be able to import them is not very fun or efficient.
-
You can also use Tintai tools to get wmo from any version to .obj and port it back to .wmo using MirrorMachineQT. You will use some stuff like lights then, but it will be working.
-
You can also use Tintai tools to get wmo from any version to .obj and port it back to .wmo using MirrorMachineQT. You will use some stuff like lights then, but it will be working.
Thank you very much! I have used MM before so I will definitely look for Tintai tools. :)
-
Hooray I've finally get some positive results!
I've make some more trials to make some python code without exactly understanding it. LOL
Seems that now vertex colors are exported but It didn't set the flag HAS_MOCV so you need to change it via hex yourself. Just after conversion wmo will have flags 09 so change it to 0D and test your vertex colors.
There is the script
Just unzip it to io_scene_wmo folder in your blender scripts folder.
[attachment=0:28se7i57]io_scene_wmo.rar[/attachment:28se7i57]
Don't forgot to backup your WMO's before exporting.
-
The new version of this tool is out along with the tutorial on how to use it:
http://www.model-changing.net/files/fil ... -25022016/ (http://www.model-changing.net/files/file/56-wmo-importexport-blender-scripts-updated-25022016/" onclick="window.open(this.href);return false;)
New features: Portals, Ambient lighting, Material flags, Global WMO settings (skybox, DBC IDs) and some more.
-
I needed some booty bay parts to my plunder island project, so i split it with this tool. Generally successful, but i have issue with vertex sahding ( colors? ) in indoor parts of new wmo.
Noggit renders them as shouls be - darker corners, shodows imitation.
Game engine reders them just fully brigt.
model has 4 objects: 1 outdoor with flag 0x09, and thee with 0x0520 flag. All these internal objects have MOCV chunk.
And now im bit confused what's wrong with this , maybe global light isused to render indoor objects?. Does internal lights could solve this issue?
-
I needed some booty bay parts to my plunder island project, so i split it with this tool. Generally successful, but i have issue with vertex sahding ( colors? ) in indoor parts of new wmo.
Noggit renders them as shouls be - darker corners, shodows imitation.
Game engine reders them just fully brigt.
model has 4 objects: 1 outdoor with flag 0x09, and thee with 0x0520 flag. All these internal objects have MOCV chunk.
And now im bit confused what's wrong with this , maybe global light isused to render indoor objects?. Does internal lights could solve this issue?
Might be missing flag hasMOCV. Might be ambient color related.
What are your group settings in Blender?
-
hmmm
flags seems to be ok ( at 1st sight), each group has:
0x20 00 - 0x2000-- Indoor
+
0x04 -Has vertex colors MOCV
+
0x01 Has MOBN and MOBR
here is screenshot of blender window, also i have attached my example wmo, Skarn could You look at it ?
thanks in advance :)
-
try to change "0x2A uint16 Number of batches interior" to the value of "0x2C uint32 Number of batches exterior". And then set "0x2C uint32 Number of batches exterior" to 0.
-
try to change "0x2A uint16 Number of batches interior" to the value of "0x2C uint32 Number of batches exterior". And then set "0x2C uint32 Number of batches exterior" to 0.
Yessss!!! :) That's solution on my issue.
Thank You Supora.