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: [WotLk] 3ds max WMO Exporter  (Read 4706 times)

abdalrahman9

  • Contributors
  • Wiki Incarnate
  • *****
  • Posts: 129
    • View Profile
[WotLk] 3ds max WMO Exporter
« on: January 31, 2016, 09:22:00 am »

3ds max Wmo Exporter


[paragraph:1bpn2nx2]Hello there, I have finally decided to release my exporter as I feel it has reached a level to where I think it might be usable or maybe be some use for some people. This is my first project and when I first started off, my intention for this exporter was to be THE Wmo exporter. I had realized through some wow Documentary that there was a very high chance that Blizzard was also using 3ds max as its home development for its Wmo models. I had first started the project in the summer in August I think. I had worked on it for a month but I eventually halted the project as university started. In the winter break (end of December), I felt the urge to reinitiate my project in create the best Wmo exporter out there that I was capable of. When I began, I had absolutely no knowledge or experience in coding (though I learned many years back python but was very basic). So it was truly a challenge for me to create a functional exporter. I had put all my heart and soul in creating this exporter and I hope it becomes what I had first envisioned it to be. It took me roughly three months to type the code and after each day I had learned new things in both programming and in the Wmo format. It was truly an interesting project to start in gear and it had its up and downs but it was worth it nevertheless. I know I have already prolonged the introduction and so before you guys get bored, I will start explaining the exporter itself.[/paragraph:1bpn2nx2]

Introduction:


[paragraph:1bpn2nx2]The function of this script is to export the Wmo scene that you currently have in 3ds max into the Wmo format which can be read through the wow engine. The wow expansion that this export supports is the Wrath Of the Lich King (WOTLK). Right now I don’t have any interest in supporting any other expansions but you never know what the future holds. To run the exporter, you must first go to “Utilities-->Maxscript-->Run Script”and press on the exporter file. You will have to re-run the script if you change anything major in the scene such as deleting a group and if an error occurs. I will inform you right now, the exporter is not flawless and I am releasing it to know the different bugs that it contains. It is hard to use if you don’t know 3ds max well but I think it is doable. I will begin by stating the properties that the exporter supports and what it doesn’t.[/paragraph:1bpn2nx2]

Supports:


•   Geometry (Indoor/Outdoor)
•   Texture/Material (Standard and Multi-Sub Materials Only)
•   Groups
•   Wmo Lights (Omni Preferable)
•   Doodads/Doodad sets
•   Portals (Rectangles Usually)
•   Binary Partition Tree
•   Vertex Color

Unsupported


•   Liquids (I got no idea how to implement. Any ideas are welcomed)
•   Skybox (Also no ideas, welcoming suggestions)
•   Flags (There are multiple flags that I don’t support which are usually ones that are unknown even in the wmowiki)
•   (Will add more if I remember anything else)

Geometry:


[paragraph:1bpn2nx2]So what would the exporter be if it didn’t even export the most basic geometry in the scene huh? Now from what I have tested so far, there hasn’t been a problem with the geometry themselves when it comes to exporting. I believe all geometries are supported.[/paragraph:1bpn2nx2]

Texture/Materials:


[paragraph:1bpn2nx2]My script only supports two types of materials which are Standard Materials and Multi-Sub Materials which are made up of Standard Materials. You can have multiple meshes having the same material and you can have even materials that are not even used in the scene but are in your material editor. Try to make sure that your material is appearing in the scene. The name of the material will be the name of the texture file name that will be used in the Wmo group. That means that if you have your material named as “Texture1”, then you should have BLP texture file name “Texture1.BLP”. Please do not add “.blp” in your material name as I add it in the script itself.[/paragraph:1bpn2nx2]

Groups:


[paragraph:1bpn2nx2]You are able to link multiple meshes/geometries under one name which is called a group. This is a function in 3ds max which can be easily used.  Every single mesh you want it to be in your Wmo has to be in a group. You are able to make each mesh/geometry to be its own group but it might be time consuming depending on the amount of meshes/geometries you have. Also, the group’s name will be the name of the group in the Wmo root file and not the individual meshes in the group. You will have three different types of groups which are Indoor or Outdoor and Indoor/Outdoor. The Outdoor group (Batch C) is just the meshes which are exterior like the outside of a house. The indoor group (Batch B) is the interior of a building which uniquely supports Wmo lights and an example is the interior of a house. Finally, the indoor/Outdoor (Batch A) group is something between the interior and exterior. It is usually a group which is the transition between an outdoor group into an indoor group. For example, the gate and the first few sets from the exterior of a house into the interior of the house is an Indoor/Exterior. A special characteristic that I found an outdoor/Indoor group has that distinguishes it from an indoor is that if it has Vertex Color then it does not only color the Wmo group but also the character himself. Take into consideration that each group can only be one type as I don’t know how to support multiple types in one group. What I mean is that one group cannot be both outdoor (Batch C) and indoor (Batch B). Each group must be only one type (Batch A, B, or C)[/paragraph:1bpn2nx2]

Wmo Lights:


[paragraph:1bpn2nx2]I will tell you the truth right away, I had never been able to see my Wmo lights in the Wmo ever or see a change of color in anything. However, my exporter creates the light anyhow and I might just be missing a flag or something which is the reason it isn’t working. Now the Wmo lights are created from actual lights in 3ds max which are created from the: Create->Lights rollout. I think the exporter only supports Omni lights but I had tried supporting the other lights but I don’t think they work. Also another important piece of information is that you will have to use a function which called “Select and Link” in 3ds max. This will allow you to link the light to the group you desire. So in essence what you need to do is create a group and after that group has been created and it is closed, link the light to the group. NOTE: Do NOT add the light into the group when you are constructing the group from the first time. What I mean by that, don’t make it a member of the group. What you need to do is link the light to the whole group.[/paragraph:1bpn2nx2]

Doodads/Doodad Sets:


[paragraph:1bpn2nx2]Doodads are representing by geometry in the scene and they could have any shape or form you like. However, it is better to actually import an m2 file from wow model viewer (OBJ) into 3ds max to have a good representation of the doodad. The name of the doodad has to be the directory to the m2 file in the MPQ. An example is if you have a doodad named as "duskwoodfootlocker01.m2", then the name it should have in the 3ds max scene is "WorldGenerichumanpassive doodadsfootlockersduskwoodfootlocker01.mdx". Make sure you remember that you put "MDX" at the end and NOT "M2".  If I remember correctly, if you import from WMV, you will have to rotate the model 90 Degrees in the positive X direction and reset it's XForm to be oriented correctly in term of how it will show up in the WMO. There is no need for the doodad to have a material as after some tries I found it troublesome. You are able to also scale the doodad BUT it has to be a UNIFORM scale. What this means is that all the three directions (x,y,z) must be scaled equally. If there is one direction which is scaled differently than another direction then a default scale of 1 will be set. Finally, when you imported and positioned all of your doodads, you will have to use another function in 3ds max which is called “Create new Set”. How you use this tool is that you select all the doodads you want to be in a set as you are able to have multiple sets and press the “Create new Set” button to create the doodads selected a set.  After you have created all your doodad sets and named each one, then you must link the set to the group. When linking, DO NOT select on one doodad and then link!! You must press on the set from the rollout to select ALL doodads in the set. Then just simply link any doodad (while have all the other doodads selected) to the intended group. With that, you would have added the doodads to the group. So the only difference between Wmo geometry and a doodad is that Wmo geometry is part of the group and the doodad is linked to the group.[/paragraph:1bpn2nx2]

Portals:


[paragraph:1bpn2nx2]The purpose of portals is to link the outdoor groups with the indoor groups so you can see outside if you are inside the indoor group. Portals are represented by Shapes in 3ds Max. Please use rectangles all the time but I do think I have written the script in a way that it can accept other shapes. However, I had not tested if it works with other shapes so I can’t guaranty it is flawless. To create Shapes, you must go to the “Create-->Shapes” rollout. Position it between the gateway of the Indoor and Outdoor groups. Now do not link the shapes to any groups and leave them by themselves. I have created a special rollout in the exporter utility where you must manually state the interior and exterior groups that the portals must link between. Now I have labeled which group should be the external and which the internal, though one time it didn’t work and I had to flip the groups around (External <-> Internal) for it to work. So if it doesn’t work in the first time try to reverse the selected groups.  I really got no idea why that time it did that. Not to mention that the shape has to be an "editable Spline" when you export.[/paragraph:1bpn2nx2]

Binary Partition Tree (BSP)


[paragraph:1bpn2nx2]Ow my … This was the HARDEST thing to write as I had no idea what this BSP was about in the beginning. After receiving help from Schlumpf, Gamh, and others from Modcraft, I had gotten the rough idea. I took much time to write it and I hated every second of it. Now I have realized that there some areas that might not have collisions and it could be because of the BSP but I thought I did a very good job in it. I might come back to it and see if I can fix it. Also to mention, there is a flag in the exporter called “MOBR/N” which is by default on. I would highly recommend that no one unchecks it as I am not sure what it will do to the Wmo groups. I just don’t want to work on the BSP for some time as I just recently finished it and can’t handle working on it again. You are not asked to input a number of nodes/leafs like how the Mirror Machine does. The reason behind that is that I had created the script to create a tree until there is at least 50 verts or less in every single leaf in the tree. This means that if you have a group which has A LOT of verts like 10,000, then the exporter will be slower. Just give it time until it process the data and 3ds max might stop responding but just give it 5 minutes and it should work find. I would suggest keeping low verts in every group so collisions can be perfect.[/paragraph:1bpn2nx2]

Vertex Color:


[paragraph:1bpn2nx2]The way that I usually add vertex color is by adding the “Vertex Paint” modifier. By default, if the modifier hadn’t been added to the mesh and no color was added through the “Editable Mesh” (Not Preferred) then no vertex colors will be exported. However, when you add the modifier, vertex colors will start to be exported. Now there are two types of painting you can do which are vertex color and vertex alpha. Ambient is just roughly how bright the vertex will be. I am not going to teach you how to use the modifier. However, I will just inform you how you can add an alpha color. By default, when you just add a vertex color layer to the mesh, the alpha of the whole vertex is set to 0 (Not Lighted). If you want it to be brighter, you must add a new vertex paint layer but this time change the channel to ‘Vertex Alpha’.  Now just paint it and the new alpha values will be exported. There are a few important notes that you must be aware of. The first one is that if one mesh in a group has vertex color then ALL the geometry/meshes in the group which are members must also have a vertex paint modifier applied to them. You can easily just do that by selecting on the members and add the vertex paint modifier on all of them. The second point is that Indoor groups DO NOT show up in game if the group doesn’t have vertex color. This means whenever you want an indoor group, you must add a vertex paint modifier on all of the mesh members in the group for them to appear in game. This only applies for indoor groups (have indoor flag set)[/paragraph:1bpn2nx2]

Unsupported:


[paragraph:1bpn2nx2]There are many things that I want to add to the exporter but I just don’t know how to implement them such as liquids. 3ds max has no supports or any type of representation for liquids in its scenes. So if anyone has a suggestion on how to implement any new feature then please get in touch with me.[/paragraph:1bpn2nx2]

Tips/Procedure:


1.   SAVE your scene BEFORE using the exporter at ALL (Trust me you will want to)
2.   Collapse/ Convert All the geometry/meshes members to Editable Mesh (Must be Mesh!)(Very Important!)
3.   Group all the meshes/geometry that you want in your individual groups
4.   Select all doodads and create the doodad sets
5.   Link the doodad set to their respective group
6.   Link the lights to their respective group
7.   Run Script
8.   Input the directory to where you want to save the file
9.   Input the Texture location in the MPQ where you will have your textures in
10.   Leave or set a WmoID for the WMO you are creating
11.   Leave/Change the flags for each group
12.   *In Case Of Portals/Shapes” Set the interior and exterior groups
13.   Press the Export Button (First time exporting meshes/scene)
14.   Now usually what happens when you first export is if your model was not exported before and was totally created in 3ds max, my exporter will break the vets of each mesh because the mesh verts must equal the texture verts (Not my function). After my exporter is finished and if you dislike how the mesh was split up then you can export as .3ds format and import it again. This way you use 3ds max’s own function on how it splits the verts.
15.   Export a second time and it usually is faster as it doesn’t have to split the verts.
16.   If no errors then check in game!! (If nothing went wrong!)

Suggestions:


[paragraph:1bpn2nx2]Please before using the export to make sure you save your scene as sometimes the exporter when it runs through an error it does something weird to the scene though only rarely. I would also suggest to first starting off with basic shapes such as a box or a sphere to see how the exporter works before moving on with personally created models. I will update this thread with pictures in the next few days to make it easier to understand and to visualize.[/paragraph:1bpn2nx2]

Thanks/Credits:


•   Will: He is the one that has supported me the most and really is the one who got me interested in wow modding. I mostly grateful for him!
•   Schlumpf: Thank you a bunch for answering all of my questions to the extent of your knowledge. If it wasn’t for you, this exporter wouldn’t be at the level it is now. Thank you!
•   Gamh:  Helped me in the painful BSP process. Thank you for the support
•   Deamon: Also aided me in the BSP understanding. Thanks a bunch!
•   Modcraft: Thank you Modcraft for if it wasn’t for you, I wouldn’t have had learned the basics and couldn’t have had my questions answered.

Download


Wmo Exporter Version 1.0

Importer


I forgot to mention that there is a wmo importer for 3ds max which was made by a coder named Taylor Mouse. It does a very good job in importing the meshs and i have been using it a lot in my process of my exporter. It currently only imports meshs and textures and doodads and nothing more. You can download it from here

Examples:
(Havne't really had the time to create many models and export them but only have one random model that i did for test purposes)



« Last Edit: February 01, 2016, 10:03:36 pm by Admin »

schlumpf

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 2967
    • View Profile
Re: [WotLk] 3ds max WMO Exporter
« Reply #1 on: January 31, 2016, 11:19:51 am »
Absolutely beautiful!

Can you add some sample screenshots for those not able to try it out?
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Alastor

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 1105
    • View Profile
Re: [WotLk] 3ds max WMO Exporter
« Reply #2 on: January 31, 2016, 12:49:42 pm »
Sounds nice--very nice

RIP in Blender
i hate all autodesk :D shame ill never try it
« Last Edit: January 01, 1970, 01:00:00 am by Admin »
No matter how fast light travels it finds the darkness has always got there first and is waiting for it
Star Citizen Referral Code : STAR-XNFS-HVL9

Met@

  • Contributors
  • Wiki Incarnate
  • *****
  • Posts: 120
    • View Profile
Re: [WotLk] 3ds max WMO Exporter
« Reply #3 on: January 31, 2016, 05:09:40 pm »
Fantastic tool, you're awesome :D Now we have exporter for Blender and 3DSmax.

And indeed Blizzard uses 3DSmax, you can see it in some Making off or Art Pannels at Blizzcon.

I think for the liquids we have to do this manually with hex edit. (after some tests with light I put lava in my house) I'm not expert with 3DS, so I can't say how it manages liquids.

Thank you for this tool ! (I think I have to update my guide)
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

schlumpf

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 2967
    • View Profile
Re: [WotLk] 3ds max WMO Exporter
« Reply #4 on: January 31, 2016, 05:56:33 pm »
You can always hack liquids by special materials / names.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

abdalrahman9

  • Contributors
  • Wiki Incarnate
  • *****
  • Posts: 129
    • View Profile
Re: [WotLk] 3ds max WMO Exporter
« Reply #5 on: January 31, 2016, 09:32:22 pm »
Update the first post with some intructional images and an example screenshot of a test wmo which i did a long time ago.

Quote from: "schlumpf"
You can always hack liquids by special materials / names.
Hum so you mean that if an object has a specific material it will be considered as liquid? Though what material would that be then? Also the geometry that the material is applied to would have to be a plane wouldn't it?
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

schlumpf

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 2967
    • View Profile
Re: [WotLk] 3ds max WMO Exporter
« Reply #6 on: January 31, 2016, 11:16:34 pm »
yep, just have a magic material with the name of LIQUID_WATER, which turns all planes with the material to liquid tiles.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

abdalrahman9

  • Contributors
  • Wiki Incarnate
  • *****
  • Posts: 129
    • View Profile
Re: [WotLk] 3ds max WMO Exporter
« Reply #7 on: February 01, 2016, 07:39:00 pm »
Okay then, i will be making a standard material that contains a tiles map a liquid. I am currently studying the MOLQ and i just want to ask what is the the materiad ID,heightmaps, and the different types of liquid there are?
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Supora

  • Registred Member
  • Wiki Incarnate
  • *****
  • Posts: 143
    • View Profile
Re: [WotLk] 3ds max WMO Exporter
« Reply #8 on: February 01, 2016, 08:46:53 pm »
So can I export second MOTV and MOCV for two-layered material? It would be very useful when making models where you need some smooth transition between two textures.
About water: didn't figured out how exactly info about transparency and uv-map is stored(I can mention that slime  liquids need to uw-mapping, but water works fine even without it). Also I tried to set material to regular diffuse material or to material with terrain type = 10 or 11(terrain type none and terrain type water) but it does nothing to my liquids so I don't know if it's really needed to have another material for water. But anyway I think that transparency and uw map stored in [heightmap] in first four bytes(height value is second four bytes) per vertex. Vertecies goes in column order. Same with tiles as I think(types in MLIQ chunk on wiki). Btw didn't actually figued out what a those types are. But they are defines which tiles will be filled with water and which won't. BTW maybe here in those types are actually two values(half of a byte for each)(wrong info. Seems that types are actually types. But if set second half of a byt to F then this water tile will not be filled)
Here is what I get just with hexing:
« Last Edit: February 01, 2016, 09:13:37 pm by Admin »

Supora

  • Registred Member
  • Wiki Incarnate
  • *****
  • Posts: 143
    • View Profile
Re: [WotLk] 3ds max WMO Exporter
« Reply #9 on: February 01, 2016, 08:54:53 pm »
Quote from: "abdalrahman9"
Okay then, i will be making a standard material that contains a tiles map a liquid. I am currently studying the MOLQ and i just want to ask what is the the materiad ID,heightmaps, and the different types of liquid there are?
Oh, didn't read this earlier. So material id is id from momt chunk. heightmaps stores info about verts. First four bytes may be transparency and uv-map, second four bytes are height values of verts. For types you can read previous post.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

schlumpf

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 2967
    • View Profile
Re: [WotLk] 3ds max WMO Exporter
« Reply #10 on: February 01, 2016, 10:15:07 pm »
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

abdalrahman9

  • Contributors
  • Wiki Incarnate
  • *****
  • Posts: 129
    • View Profile
Re: [WotLk] 3ds max WMO Exporter
« Reply #11 on: February 01, 2016, 10:42:05 pm »
Currently Imported and exported a temple in the darnassis to test me exporter. As i thought, there are some parts that have collisions problems huh.... man i really thought that i did the BSP perfectly...

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

Will

  • Contributors
  • Wiki Incarnate
  • *****
  • Posts: 140
    • View Profile
Re: [WotLk] 3ds max WMO Exporter
« Reply #12 on: February 02, 2016, 10:31:51 pm »
Well done for this. Abdo is one of the quickest learners i've ever worked with i think, so expect more good things from this guy.. (:
« Last Edit: January 01, 1970, 01:00:00 am by Admin »
- JutsuONLINE - http://www.jutsuonline.co/
Always recruiting. Contact me

sshroud

  • Registred Member
  • Race Changer
  • *****
  • Posts: 25
    • View Profile
Re: [WotLk] 3ds max WMO Exporter
« Reply #13 on: February 07, 2016, 01:58:41 am »
Hey, great stuff, really commendable altogether. I find it especially cool that you've got portals working.

I would really love to see this hooked to the Blender API as well, as many (including myself) prefer modern Blender over the expensive and IMHO convoluted Autodesk software.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

abdalrahman9

  • Contributors
  • Wiki Incarnate
  • *****
  • Posts: 129
    • View Profile
Re: [WotLk] 3ds max WMO Exporter
« Reply #14 on: February 10, 2016, 01:11:17 am »
Hello there, Now there are still things to improve to this tool and currently i am short with free time as university started again. I will most likely work on this script again when i come back and i know many have said the same didn't ever come back. However, i am still interested in this project and i hope i still will be when i finish this semester. Though, if you guys have any suggestions still please send them over.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »