This is a read only copy without any forum functionality of the old Modcraft forum.
If there is anything that you would like to have removed, message me on Discord via Kaev#5208.
Big thanks to Alastor for making this copy!

Menu

Author Topic: [TOOL] Blender 2.5+ WMO import/export script  (Read 17145 times)

happyhack

  • Contributors
  • Race Changer
  • *****
  • Posts: 38
    • View Profile
[TOOL] Blender 2.5+ WMO import/export script
« 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



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

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.



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.
« Last Edit: April 14, 2014, 12:48:29 am by Admin »

Skarn

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 807
    • View Profile
    • http://skarn-project.net
Re: [TOOL] Blender 2.5+ WMO import/export script
« Reply #1 on: March 26, 2014, 02:51:05 pm »
Dude, I'll test it right now! Awesome. Check PM please.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Serifaz

  • Contributors
  • Model Change Addict
  • *****
  • Posts: 293
    • View Profile
Re: [TOOL] Blender 2.5+ WMO import/export script
« Reply #2 on: March 27, 2014, 04:42:04 pm »
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.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Skarn

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 807
    • View Profile
    • http://skarn-project.net
Re: [TOOL] Blender 2.5+ WMO import/export script
« Reply #3 on: March 27, 2014, 06:44:10 pm »
Does the export function exports working models? I mean can they be used in the game?
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

happyhack

  • Contributors
  • Race Changer
  • *****
  • Posts: 38
    • View Profile
Re: [TOOL] Blender 2.5+ WMO import/export script
« Reply #4 on: March 27, 2014, 06:51:33 pm »
Nop, export doesnt work, there is yet some things to do before working on export (importing liquids, lights, collision meshes, and doodads)
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

happyhack

  • Contributors
  • Race Changer
  • *****
  • Posts: 38
    • View Profile
Re: [TOOL] Blender 2.5+ WMO import/export script
« Reply #5 on: March 28, 2014, 04:57:31 pm »
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.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Supora

  • Registred Member
  • Wiki Incarnate
  • *****
  • Posts: 143
    • View Profile
Re: [TOOL] Blender 2.5+ WMO import/export script
« Reply #6 on: March 28, 2014, 07:58:26 pm »
*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]
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Steff

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 4551
    • View Profile
Re: [TOOL] Blender 2.5+ WMO import/export script
« Reply #7 on: March 28, 2014, 09:52:04 pm »
Domt care aboit m2.  That is the job for an extra rool.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »
Please mark as solved if solved.
Don't ask if you could ask a question... JUST ask the Question.
You can send me also offline messages. I will answer if I get online.
Skype: project.modcraft
Discord: steff#6954

happyhack

  • Contributors
  • Race Changer
  • *****
  • Posts: 38
    • View Profile
Re: [TOOL] Blender 2.5+ WMO import/export script
« Reply #8 on: March 28, 2014, 11:26:00 pm »
Quote
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

Quote
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
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Steff

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 4551
    • View Profile
Re: [TOOL] Blender 2.5+ WMO import/export script
« Reply #9 on: March 29, 2014, 09:20:18 am »
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.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »
Please mark as solved if solved.
Don't ask if you could ask a question... JUST ask the Question.
You can send me also offline messages. I will answer if I get online.
Skype: project.modcraft
Discord: steff#6954

Skarn

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 807
    • View Profile
    • http://skarn-project.net
Re: [TOOL] Blender 2.5+ WMO import/export script
« Reply #10 on: March 29, 2014, 04:53:18 pm »
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.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

iindigo

  • Registred Member
  • Wiki Incarnate
  • *****
  • Posts: 198
    • View Profile
Re: [TOOL] Blender 2.5+ WMO import/export script
« Reply #11 on: March 29, 2014, 07:39:57 pm »
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.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Skarn

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 807
    • View Profile
    • http://skarn-project.net
Re: [TOOL] Blender 2.5+ WMO import/export script
« Reply #12 on: March 30, 2014, 08:44:57 am »
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.
« Last Edit: March 30, 2014, 12:05:24 pm by Admin »

Steff

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 4551
    • View Profile
Re: [TOOL] Blender 2.5+ WMO import/export script
« Reply #13 on: March 30, 2014, 11:21:48 am »
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.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »
Please mark as solved if solved.
Don't ask if you could ask a question... JUST ask the Question.
You can send me also offline messages. I will answer if I get online.
Skype: project.modcraft
Discord: steff#6954

happyhack

  • Contributors
  • Race Changer
  • *****
  • Posts: 38
    • View Profile
Re: [TOOL] Blender 2.5+ WMO import/export script
« Reply #14 on: March 31, 2014, 09:28:25 pm »
Quote from: "Skarn"
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

Quote from: "Steff"
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

« Last Edit: January 01, 1970, 01:00:00 am by Admin »