Retera Model Studio Reforged Hack

Retera

Tool Reviewer
Level 27
Joined
Apr 19, 2008
Messages
1,183
Hi guys. I've been going around the internet toting the potential of a Retera Model Studio Reforged hacked version and the kinds of things that it could make.

Everyone who saw it wanted access to the technology so that they could begin making their own Reforged models in the same way that I was doing.

At first I was thinking maybe I could run this like I was doing Retera Model Studio, where I develop slowly over a huge number of years and then publish my progress whenever I feel like it's getting good. But to be honest, Reforged Beta is happening *NOW* and so if there is any chance that my tool would be useful to people, it is silly to keep them waiting. One guy already figured out that he could download the code of the tool and run it from source at my github link (Retera/JWC3) but the average user does not want to bother with that.

So I decided that although this isn't a finished tool to go in the tools section yet, nor to replace the Retera Model Studio that is on there, I could do these nightly builds of the Reforged-compatible version of this thing, where I figure I will just edit this post every night or every few nights with the latest snapshot of whatever state my program is in.

Obviously, that means there will be bugs. There ARE bugs. This thing has so many bugs, and is so incredibly laggy, I know that I will feel your pain in my dreams even if I'm asleep while you use it. But that's OK because I was already using it, so that shows it is good for something.

Technological teasers:



Things you must know before using this modified Retera Model Studio client:
  1. This is a prototype with hacked in support for Reforged model so a huge bunch of stuff is not working correctly
  2. You should be able to open classic Warcraft III model files in this tool and press the magic button on them to then save them in the Reforged formatted way, so that the Reforged Beta accepts your model 100%. (Even starting tomorrow if Blizzard does another patch, this might no longer be necessary.)
  3. I use a CASC parser called JCASC developed by DrSuperGood to load Blizzard's warcraft game data from inside of a Java program. JCASC doesn't support encrypted data like Reforged yet, and Blizzard did not give DrSuperGood access to the beta yet (and I was lazy and didn't go add to his code), so in order to use this, you have to get ALL OF THE REFORGED FILES IN A FOLDER ON YOUR COMPUTER BY YOUR OWN MEANS and then point my tool at the folder. It doesn't understand the game format. (I used the casc viewer tool that I found on Google search for this purpose)
  4. It probably crashes if you don't do that and point it at standard WC3 instead. Not really sure.
  5. If you are working on a reforged model, the way 3d stuff links to animations changed, so I fixed the previewer so it will preview some animations for you sometimes and allow you to see the names and get a feel for hidden animations -- and there are LOTS of hidden cinematic animations in special poses like the footman cleaning his shield -- but if you go into the animation editor even though it works you can't see what you're doing.
  6. One of my big focuses over the weekend was the MDL format. I just told a guy that I upgraded the MDL format and he asked me "Aaaaaah... INTERESTING! but but didn't model making move away from the MDL format? All I see, in like "Iceborn" map are MDX files.. not MDL files..." MDL format is what you have instead of the Magos application. It is text so you can read it. You can read the name of your shader that your material is using or read the name of the PBX file used in your popcorn emitter or you can change which facefx facial animation file your model is referencing.
  7. My MDL format that this saves to is not consistent with any other program because I was not aware of any other MDL systems. If Blizzard published the new MDL specifications, please post on this thread and we will change my made-up specifications for my own MDL that I invented and then we will use the Blizzard specifications instead, like how it was for the old MDL format in the old days, I figure.
  8. The only binary system I have observed that my MDL format does not convert correctly when it goes between MDL and MDX are new shading flags on the materials. I found the TwoSided flag and so I support that again (it's a material flag now rather than a layer flag) but there are other flags and I didn't go figure out what they are and therefore this tool will erase them by accident while editing. I already noticed a tuft of grunt hair that caused me to fix TwoSided but there are probably other similar missing materials. But I support popcorn particles (references, I haven't looked at PBX files yet) and so you can at least attempt to transfer them between models using the Import functionality.
  9. I included the unit meta data file some people were wondering about that was referenced in a video that I made over the weekend. It lets you fix the icons on your custom units' abilities in the current reforged beta (hopefully fixed soon like tomorrow in a patch, who knows, so then that won't even be necessary)
  10. And thanks again to Ghostwolf for his open source solutions and support with MDX900, couldn't have done this without him.
Edit: Now updated with version 0.04.2020.01.04 with a rough draft of recalculate tangents feature. I have also removed the older versions. If you need those in the future, they should be available when building from source from my github repo.
 

Attachments

  • JainaDoSDismounted.png
    JainaDoSDismounted.png
    947.1 KB · Views: 10,018
  • JainaDoSTeaser.png
    JainaDoSTeaser.png
    1.7 MB · Views: 9,928
  • cleaning_shield.gif
    cleaning_shield.gif
    6.1 MB · Views: 11,257
  • surfbro2.gif
    surfbro2.gif
    5.7 MB · Views: 10,633
  • bgsheep.png
    bgsheep.png
    5.2 MB · Views: 10,674
  • unitmetadata.slk
    69.3 KB · Views: 320
  • ReterasModelStudioV0.04.2020.01.05.zip
    62.9 MB · Views: 1,127
  • ReterasModelStudioV0.04.2020.02.11.zip
    62.8 MB · Views: 627
  • ReterasModelStudioV0.04.2020.03.01.zip
    62.8 MB · Views: 412
  • ReterasModelStudioV0.04.2020.03.03.zip
    62.8 MB · Views: 1,808
  • ReterasModelStudioV0.04.2020.08.03.zip
    62.9 MB · Views: 100
  • ReterasModelStudioV0.04.2020.08.06.zip
    63 MB · Views: 142
  • ReterasModelStudioV0.04.2020.08.07.zip
    63 MB · Views: 613
  • ReterasModelStudioV0.04.2020.08.10.zip
    65.6 MB · Views: 409
  • ReterasModelStudioV0.04.2020.09.19.zip
    65.6 MB · Views: 1,556
Last edited:
Level 3
Joined
May 29, 2014
Messages
31
Retera, did I use the right CASC Viewer? There are multiple ones out there. I used this one here: Casc Storages - Main page

I have used this tool in the past to get icons, models from Reforged.

However, I can't get this to work with Retera Model Studio 0.04... been banging my head against the wall... t just gives an error message of 2 attempts already used... I tried adding it as a CASC folder with the mods, then as just simply a folder, then tried even pointing to the C drive installation of Warcraft III Reforged. No dice... I know this has worked with the original vanilla classic WC3TFT with Retera Model Studio 0.03... I'm setting up the folder/CASC directory wrongly, I'm afraid.... however even with the vanilla classic WC3TFT CASC... the new 0.04 is crashing and not working> GAH, so close yet so far.. it must be something silly I'm missing

Does Retera Model Studio need the ENTIRE CASC folder of Reforged? A lot of the files aren't actually used. And only the "_hd.w3mod" seems to be the active one. Why can't we just specify that file alone? Just trying to understand RMS requirements.
 
Level 5
Joined
Mar 6, 2017
Messages
169
Retera, did I use the right CASC Viewer? There are multiple ones out there. I used this one here: Casc Storages - Main page

I have used this tool in the past to get icons, models from Reforged.

However, I can't get this to work with Retera Model Studio 0.04... been banging my head against the wall... t just gives an error message of 2 attempts already used... I tried adding it as a CASC folder with the mods, then as just simply a folder, then tried even pointing to the C drive installation of Warcraft III Reforged. No dice... I know this has worked with the original vanilla classic WC3TFT with Retera Model Studio 0.03... I'm setting up the folder/CASC directory wrongly, I'm afraid.... however even with the vanilla classic WC3TFT CASC... the new 0.04 is crashing and not working> GAH, so close yet so far.. it must be something silly I'm missing

Does Retera Model Studio need the ENTIRE CASC folder of Reforged? A lot of the files aren't actually used. And only the "_hd.w3mod" seems to be the active one. Why can't we just specify that file alone? Just trying to understand RMS requirements.
load the casc directly by the tool
 
Level 3
Joined
May 29, 2014
Messages
31

Oh ok, so you have the same issue as me then?

Add CASC FAIL
NOTE: Yes, I'm adding from the Warcraft III Reforged installation here... but I get the same error from Add Folder from CASC_VIEW extracted "_hd.w3mod" anyways, or "war3.w3mod" or "_deprecated.w3mod".

First Error Message:

Second Error Message:
 
Last edited:

Retera

Tool Reviewer
Level 27
Joined
Apr 19, 2008
Messages
1,183
In order for it to work, I had to layer 5 folders in order. I forgot to mention this. I loaded:

Code:
war3.w3mod
war3.w3mod\_locales\<lang>.w3mod
war3.w3mod\_deprecated.w3mod
war3.w3mod\_hd.w3mod
war3.w3mod\_hd.w3mod\_locales\<lang>.w3mod

For <lang> thus far I only tested enus

Sorry this is complicated, but I think this is close to the correct list of mods used by the game so that we can load game files for quick browsing unit data.

These folders were added as folders, not CASC, to make it work for me. As mentioned before, the built in casc functionality is not working correctly on this edition of my code.

Edit: So, if it's not clear, the folders do not come with the installation of Reforged Beta. You will not find them. Make 15GB extra hard disk space, then extract all to these folders with some other CASC tool
 
Last edited:

Retera

Tool Reviewer
Level 27
Joined
Apr 19, 2008
Messages
1,183
@slimlocker For me, as long as the "View -> Texture Models" option is turned on, then it should load the texture and display it. I load the 4-6 layers of the material and then throw them all away, except for the Diffuse layer. It is loaded by DDSUtils that I found online from this repo:
Dahie/DDS-Utils

It looks to me like this DDS library is too slow and cannot load ORM/NORM textures. That's why I only display the diffuse layer. I know it is very different from the in-game appearance.

@chopinski @CentaurWarlord When I have some spare time tonight, I might get my old computer and made a tutorial explaining how to set up this tool on a fresh computer.
 
Level 4
Joined
Aug 4, 2011
Messages
71
I keep getting these two errors. The longer one shows up after I add my install directory, and the smaller one shows up when i click OK after adding the main extraction folder. This is the first time Ive ever used your program, so I have no idea what I am doing.

Also, thanks for your help here and on Reddit. I'm highlordanduin over there.
 

Attachments

  • Retera Model Editor 2.JPG
    Retera Model Editor 2.JPG
    57.1 KB · Views: 424
  • Retera Model Editor.JPG
    Retera Model Editor.JPG
    183.8 KB · Views: 393
Level 11
Joined
May 16, 2012
Messages
517
@slimlocker For me, as long as the "View -> Texture Models" option is turned on, then it should load the texture and display it. I load the 4-6 layers of the material and then throw them all away, except for the Diffuse layer. It is loaded by DDSUtils that I found online from this repo:
Dahie/DDS-Utils

It looks to me like this DDS library is too slow and cannot load ORM/NORM textures. That's why I only display the diffuse layer. I know it is very different from the in-game appearance.

@chopinski @CentaurWarlord When I have some spare time tonight, I might get my old computer and made a tutorial explaining how to set up this tool on a fresh computer.

ok, thank you very much.
 
Level 3
Joined
May 29, 2014
Messages
31
In order for it to work, I had to layer 5 folders in order. I forgot to mention this. I loaded:

Code:
war3.w3mod
war3.w3mod\_locales\<lang>.w3mod
war3.w3mod\_deprecated.w3mod
war3.w3mod\_hd.w3mod
war3.w3mod\_hd.w3mod\_locales\<lang>.w3mod

For <lang> thus far I only tested enus

Sorry this is complicated, but I think this is close to the correct list of mods used by the game so that we can load game files for quick browsing unit data.

These folders were added as folders, not CASC, to make it work for me. As mentioned before, the built in casc functionality is not working correctly on this edition of my code.

Edit: So, if it's not clear, the folders do not come with the installation of Reforged Beta. You will not find them. Make 15GB extra hard disk space, then extract all to these folders with some other CASC tool

Thank you SO much for that code snippet. I got it to work. YAAAAY!

Basically, I think I just failed to connect the localisations with the _locales and enus

Basically, war3.w3mod followed by the _locales... I think what I was missing were the _locales\enus.w3mod, basically the 2 localisations were missing and that's mebbe perhaps connected to the 2 failed attempts


What's strange is that I DEFINITELY tried the "Add Folder" approach, but I added only the "war3.w3mod", the "_hd.w3mod" and the "_deprecated.w3mod" without the "_locales\enus.w3mod" folders under BOTH the "war3.wmod" and the "_hd.w3mod". THOSE were the crucial parts, I think :D

I used CASC_VIEW by zezula to download all 15-20 GBs of the Warcraft III Reforged. Then, I "Add Folder" NOT "Add CASC" or "Add MPQ". Add the specific folders as Retera has shown and how I have shown above in the pic.

Basically, my path is: E:\MODS\AI_MODS\WARCAFT3\WC3R_BETA_RESOURCES\FULL_CASC_WC3R_BETA

My E drive is my 1TB HDD where I store ALL my modded files, texutres, models. My 1 TB SSD is only for the OS and the executables (actually it's down to just 170 GBs... so I probably need to invest into another 1 TB SSD drive; I do try to keep modding EXECUTABLES on the SSD as well, perhaps that could make the RMS faster, Retera?). I try to keep my SSD free from the modding files which are better suited to be living on the HDD drive that is far more expendable.

Hopefully, you chopinski were able to make this work as well. Unfortunately, I can't help you further until I get back from a work conference this Sunday, late at night.

Gah, I really really want to dig into this tool, especially for a Centaur Ascendant unit with wings (of Eagle) using the Outrunner model but with archer animations of Impaler. I'll need Retera's help still, but I'll try to do this Centaur Ascendant as much as possible on my own first. It's just I don't have much time in the next 5 hours before I have to go to the airport for the work conference trip. Grrr lol >_<

Cheerios! :D
 
Last edited:
Level 1
Joined
Jun 10, 2012
Messages
3
@slimlocker For me, as long as the "View -> Texture Models" option is turned on, then it should load the texture and display it. I load the 4-6 layers of the material and then throw them all away, except for the Diffuse layer. It is loaded by DDSUtils that I found online from this repo:
Dahie/DDS-Utils

Any tips on how to integrate/install this? Sorry about the needy questioning hehe...
 
Level 11
Joined
May 16, 2012
Messages
517
You should be able to open classic Warcraft III model files in this tool and press the magic button on them to then save them in the Reforged formatted way, so that the Reforged Beta accepts your model 100%. (Even starting tomorrow if Blizzard does another patch, this might no longer be necessary.)


Great tutorial, it worked! Wheres this magic button??
 
Level 1
Joined
Jun 10, 2012
Messages
3
@slimlocker I am not sure, as it was supposed to work automatically. Years ago someone told me they had this problem, all the models were white regardless, and that it went away when they updated their graphics drivers. I'm not sure.

Works now! :) I installed before you put out the installation guide and just went full trial and error mode. Uninstalled and resintalled using your guide, now it works! :) Thanks for this release!

Just curious how you delete materials, like you mentioned before.
 
Last edited:
Level 11
Joined
May 16, 2012
Messages
517
@Retera your magic button worked! but the models still looks pretty dark in game. I've attached 4 pics. The first is a muradin model before your magic button, which is not correctly loaded by the game,this is how the model looks in your editor. The 2 is the model loaded in the game after the magic button and the 3 is the model in your editor after as well. The 4 is a Sylvanas model that is correctly loaded by the world editor and looks ok. Any idea on why this heppens and do your editor have a tool to make the model look as it should. Thx for your work btw, realy excited for it.

2.png 4.png 1.png 3.png
 
Last edited:

Retera

Tool Reviewer
Level 27
Joined
Apr 19, 2008
Messages
1,183
There's a second layer of normals called "tangents" that I usually just populate with a clone of normals. I didn't make a tool for that but it's the next step after "assign format version 900" to do the upgrade. Did you try inserting a "tangent" block with a copy of all of the normals?

Edit: Usually I think it having a tangents block goes hand in hand with having a "Skin" block which despite its name defines the linking between mesh and animation in "the new way". My code assumes that if it has one, it should have the other, otherwise it treats the model as the "MDX900 tagged models with mostly MDX800 information". An example of this format of model from Reforged would be the SD footman on the Reforged engine. We can convert the old way to the new HD models way of animation binding (SKIN block), but really if you're porting from some other game like HotS or SC2, Ghostwolf told me from his format research that those games support bone weights in their mesh to animation linking.

So if you go directly from say SC2 or HotS, then convert to MDX900, you would be able to transfer the same more accurate skin information. This would be contrary to doing M3->MDX800->MDX900 where because of the middleman you would lose animation binding information.

Admittedly, though, the model looks animated, so maybe you already overcame that somehow. Haven't worked on M3 myself.

Edit 2: If I fight with the model a bunch and add TANG+SKIN+new style material with blanked NORM and ORM, I got a test model someone gave me to look like this:


Left hand side custom model: MDX900 format but the model using otherwise MDX800 data
Right hand side custom model: MDX900 format model hand modified to have
  1. TANG chunk and SKIN chunk
  2. Use shader "Shader_HD_DefaultUnit"
  3. Fill NORMAL texture with solid color (128,128,255) to indicate center X and Y, and vertically outward Z normal info
  4. Fill ORM texture with (128, 255, 0) meaning 128 occlusion, 255 roughness (not shiny, probably) and 0 metallic (not shiny, hopefully)

If you do this wrongly with bad ORM you get the character made of metal:


EDIT: THE FRONT PAGE INCLUDES BUILD 0.04.2019.11.15 THAT GIVES YOU GUYS A BUTTON TO DO THIS SAME PROCESS TO ANY MODEL TO TEST WITH (Scripts -> SD to HD (experimental...))
 
Last edited:

Retera

Tool Reviewer
Level 27
Joined
Apr 19, 2008
Messages
1,183
As another note that I forgot to mention, version 2019.11.15 that is included at the top of this thread now also fixes the bug with Hero Glow, so that you can edit reforged hero models and the glow does not turn solid white.

Edit:

Based on some initial tests (I've only had the update for a few hours), models previously saved with this tool do not work anymore for the latest patch of Reforged that added the Night Elves. You can expect an update soon for the new model format.

SD models are now supported in Reforged, eliminating the need for the `Assign FormatVersion 900` button, which is very, very nice!
 
Last edited:
Level 2
Joined
Nov 7, 2019
Messages
9
WOW, this is a useful program, now I don’t need to upload the model in 3ds max one at a time, just to look at the model, I will use it as a “catalog”.
 
Last edited:
Level 8
Joined
Jul 22, 2010
Messages
29
@Retera Is there a way (or might there be a way in the near future) that we can import/assign custom normal and orm maps onto the SD -> HD models instead of them being auto populated through the script?

I've been trying to edit the paths of the textures it generates to use the custom textures, but they don't appear to working properly.
 
Level 11
Joined
Mar 18, 2014
Messages
580
@Retera Is there a way (or might there be a way in the near future) that we can import/assign custom normal and orm maps onto the SD -> HD models instead of them being auto populated through the script?

I've been trying to edit the paths of the textures it generates to use the custom textures, but they don't appear to working properly.

An overall material manager to select\add those stuff would be good also the team colour issue must be solved
 
There's a second layer of normals called "tangents" that I usually just populate with a clone of normals. I didn't make a tool for that but it's the next step after "assign format version 900" to do the upgrade. Did you try inserting a "tangent" block with a copy of all of the normals?

Edit: Usually I think it having a tangents block goes hand in hand with having a "Skin" block which despite its name defines the linking between mesh and animation in "the new way". My code assumes that if it has one, it should have the other, otherwise it treats the model as the "MDX900 tagged models with mostly MDX800 information". An example of this format of model from Reforged would be the SD footman on the Reforged engine. We can convert the old way to the new HD models way of animation binding (SKIN block), but really if you're porting from some other game like HotS or SC2, Ghostwolf told me from his format research that those games support bone weights in their mesh to animation linking.

So if you go directly from say SC2 or HotS, then convert to MDX900, you would be able to transfer the same more accurate skin information. This would be contrary to doing M3->MDX800->MDX900 where because of the middleman you would lose animation binding information.

Admittedly, though, the model looks animated, so maybe you already overcame that somehow. Haven't worked on M3 myself.

Edit 2: If I fight with the model a bunch and add TANG+SKIN+new style material with blanked NORM and ORM, I got a test model someone gave me to look like this:


Left hand side custom model: MDX900 format but the model using otherwise MDX800 data
Right hand side custom model: MDX900 format model hand modified to have
  1. TANG chunk and SKIN chunk
  2. Use shader "Shader_HD_DefaultUnit"
  3. Fill NORMAL texture with solid color (128,128,255) to indicate center X and Y, and vertically outward Z normal info
  4. Fill ORM texture with (128, 255, 0) meaning 128 occlusion, 255 roughness (not shiny, probably) and 0 metallic (not shiny, hopefully)

If you do this wrongly with bad ORM you get the character made of metal:


EDIT: THE FRONT PAGE INCLUDES BUILD 0.04.2019.11.15 THAT GIVES YOU GUYS A BUTTON TO DO THIS SAME PROCESS TO ANY MODEL TO TEST WITH (Scripts -> SD to HD (experimental...))

Don't copy Normals into Tangents. You can derive tangents by rotating the normals 90 degress towards an axis. To obtain the axis you produce vector V1 = N + Vertex, you obtain V2 = Normalize(Proj(V1, Vertex) - Vertex). Once there you can either do AngleAxis rotations (Axis–angle representation - Wikipedia) to rotate the normal using V2 as rotational axis 90 or -90 degress. To assert you did it right dot(T, N) == 0. Have in mind this is an approximation, it won't yield the best results but models will look a lot better than by copying normals into tangents.

Here's a more precise tactic: Finding bi-normals/tangents
A bit harder to setup as you may have to recalculate normals as well based on what you have (you calculate a face normal as the added 3 of normals on each vertex renormalized). You don't need the binormal, the game's shaders will guess it from crossing tangent and normal.
 
Last edited:

Retera

Tool Reviewer
Level 27
Joined
Apr 19, 2008
Messages
1,183
Interesting. I appreciate your comment. This leaves me with a curious unanswered question: how do I know if the tangents are correct? What are they used for? The normals were used for lighting, but I can't imagine they would need to include a tangents block if there was already a normals block. It seems weirdly redundant because of what I don't know about their code and the new rendering engine.

I guess the two are fundamentally different concepts, and I had the idea to populate tangents with normals probably late at night, but doing so made a stack of cubes on CanFight's minecraft map look much better than before I gave them a TANG block.

I'm not well versed in MAXScript but the code you linked looks pretty readable. I'll try to implement that in my next build.
 
Interesting. I appreciate your comment. This leaves me with a curious unanswered question: how do I know if the tangents are correct? What are they used for? The normals were used for lighting, but I can't imagine they would need to include a tangents block if there was already a normals block. It seems weirdly redundant because of what I don't know about their code and the new rendering engine.

I guess the two are fundamentally different concepts, and I had the idea to populate tangents with normals probably late at night, but doing so made a stack of cubes on CanFight's minecraft map look much better than before I gave them a TANG block.

I'm not well versed in MAXScript but the code you linked looks pretty readable. I'll try to implement that in my next build.

Old rendering systems just used a simple normal per vertex to do lighting. In modern systems, normal mapping is a thing. Normally normal maps can be in World or Tangent coordinates. World normal maps are useless as they can't be recycled and are hard to bake for every engine. Most games use Tangent Space Normal maps. This normal maps need to be transformed to World space, this is where the model's normal and tangent come into place. The shaders create a coordinate space using the Normal, a Tangent and a Binormal for transforming the pixel normal in tangent space to world space. The shader produces a TNB matrix (Tangent Normal Binormal) and multiplies it by the pixel normal to create the world normal for that pixel.

Now what's a tangent? If you look at a normal from 3ds max or some 3d tool, you'll notice it's an small vector that's normally perpendicular to the surface. The tangent is a vector that's parallel to the surface and is perpendicular to the normal. Tangent, Normal and Binormal form a 3D Axis. (Think of the x,y,z gizmo you see normally in 3D tools). The tangent's use is to remediate seams in models. When 2 connected meshes have disjoint Unwraps, artifacts may present on lighting on the original Normal-only model, the tangent is used to correct the lighting in those seams. You can look an overview here: Normal Map Technical Details - polycount

About the algorithm, I found @Taylor_Mouse did a very accurate algorithm in his Reforge exporting tools: TaylorMouse/MaxScripts

That algorithm is based on the one showed earlier but it shows how to correct tangents per vertex.

EDIT: to know a tangent is correct, it should be perpendicular to a normal. this means "dot(Normal, Tangent) == 0" Now the orientation of that tangent may be another issue but if you do that algorithm, you should have very good results.
 
Last edited:
Level 2
Joined
Oct 17, 2019
Messages
4
Not sure if it helps but I've dumped the changed chunks of the MDL structure from the client (build 13769) for v1000, everything else appears to be the same. Order of export is the same but with CORN after PRE2 and FAFX then BPOS at the end.

v900 is now obsolete (this build errors on reading) but if you want to support it you just need to ignore the fresnel fields in Layer.

Code:
Model "%s" {
    NumGeosets %d,                                            // all 0 size NumXs are skipped
    NumGeosetAnims %d,
    NumHelpers %d,
    NumLights %d,
    NumBones %d,
    NumSoundEmitters %d,
    NumAttachments %d,
    NumParticleEmitters %d,
    NumParticleEmitters2 %d,
    NumParticleEmittersPopcorn %d,
    NumRibbonEmitters %d,
    NumEvents %d,
    NumFaceFX %d,
    BlendTime %d,
    MinimumExtent { %.3f, %.3f, %.3f },
    MaximumExtent { %.3f, %.3f, %.3f },
    BoundsRadius %.3f,
    AnimationFile "%s",                                      // if not empty
}

Materials %d {
    Material {
        TwoSided,                                            // if shader != "Shader_SD_FixedFunction"
        PriorityPlane %d,                                    // if not 0
        Shader "%s",                                         // "Shader_SD_FixedFunction" or "Shader_HD_DefaultUnit"
        Layer {
            FilterMode "%s",                                 // None, Transparent, Blend, Additive, AddAlpha, Modulate, Modulate2x
            Unshaded,                                        // if flags & 0x1
            SphereEnvMap,                                    // if flags & 0x2
            TwoSided,                                        // if flags & 0x10
            Unfogged,                                        // if flags & 0x20
            NoDepthTest,                                     // if flags & 0x40
            NoDepthSet,                                      // if flags & 0x80
            Unlit,                                           // if flags & 0x100
            static TextureID %d,                             // or int track
            TVertexAnimId %u,                                // if TextureAnimationId not 0
            CoordId %u,                                      // if !SphereEnvMap, 
            static Alpha %.3f,                               // or float track
            static EmissiveGain %.3f,                        // or float track, skipped if static == 1.0
            static FresnelColor { %.3f, %.3f, %.3f },        // or float3 track, skipped if static == { 1.0, 1.0, 1.0 }
            static FresnelOpacity %.3f,                      // or float track, skipped if static == 0
            static FresnelTeamColor %.3f,                    // or float track, skipped if static == 0
        }
    },
    ...
}

Geoset {
    Vertices %d {
        { %.3f, %.3f, %.3f },
        ...
    },
    Normals %d {
        { %.3f, %.3f, %.3f },
        ...
    },
    TVertices %d {
        { %.3f, %.3f, %.3f },
        ...
    },
    VertexGroup {
        %d,
        ...
    },
    Tangents %d {
        { %.3f, %.3f, %.3f, %.3f },
        ...
    },
    SkinWeights {
        { %u, %u, %u, %u, %u, %u, %u, %u },
        ...
    },
    Faces %d %d {
        %s {                                                // Triangles etc
            { %d, ... },
        }
    }
    Groups %d %d {
        Matrices { %d, ... },
        ...
    },
    MinimumExtent { %.3f, %.3f, %.3f },
    MaximumExtent { %.3f, %.3f, %.3f },
    BoundsRadius %.3f,
    Anim {
        MinimumExtent { %.3f, %.3f, %.3f },
        MaximumExtent { %.3f, %.3f, %.3f },
        BoundsRadius %.3f,
    },
    MaterialId %d,                                            // if not 0
    SelectionGroup %d,
    Unselectable,                                             // if flags & 4
    LevelOfDetail %d,
    Name "%s",                                                // if not empty, lod filename
}

// NOTE: for some reason the base "Node" tracks are written twice
// once at the top and once at the bottom
ParticleEmitterPopcorn "%s" {
//-- base "Node" fields, ObjectId etc --//
    SortPrimsFarZ,                                            // if node.flags & 0x10000
    Unshaded,                                                 // if node.flags & 0x8000
    Unfogged,                                                 // if node.flags & 0x40000
    static LifeSpan %.3f,                                     // or float track
    static EmissionRate %.3f,                                 // or float track
    static Speed %.3f,                                        // or float track
    static Color { %.3f, %.3f, %.3f },                        // or float3 track
    static Alpha %.3f,                                        // or float track
    ReplaceableId %d,                                         // if not 0
    Path "%s",                                                // if not empty, *.pkfx file
    AnimVisibilityGuide "%s",                                 // if not empty, e.g. "Always=on, Death=off, Decay=off"
//-- "Node" Translation, Rotation and Scaling tracks again --//
}

FaceFX "%s" {
    Path "%s",                                                // *.facefx file
}

// NOTE: the count comment is part of the export however
// I've not checked if mandatory
BindPose {
    Matrices %d {
        { %12g, %12g, %12g, %12g, %12g, %12g, %12g, %12g, %12g, %12g, %12g, %12g }, // %d
        ...
    }
}
 
Level 2
Joined
May 16, 2010
Messages
12
Wow, this is amazing stuff. Got it working - if people are following the tutorial and still no luck, running the tool as admin will solve it.

First thing ima do is dismount all the mounted characters!
 
Level 15
Joined
Jul 1, 2008
Messages
1,024
Is there a tutorial on how to work this?

I used to do a lot of model editing using WC3 classic art tools but Reforged seems a lot more complicated. I opened Retera's Model Studio but couldn't even work out ho to open an existing WC3 reforged model, I was hoping to have a play about with it :(
 

Retera

Tool Reviewer
Level 27
Joined
Apr 19, 2008
Messages
1,183
@Marshmalo In general, yes. The video I posted on the previous page gives a tutorial how to set up this hacked copy of my tool. It doesn't really work well otherwise.


Also, for anybody who knows how to build from source, the online source version is ahead of the download link and I forgot to update it again. I changed out the DDS texture parser to one that is slightly faster to reduce lag.

Edit: Hopefully it won't be difficult to use. My goal is to do stuff to make it easier. But I never quite caught up with Magos in terms of features because I am so much of a Notepad++/MDL user and so I wasn't incentivized to bother with stuff like "Material Manager". I want to add those, but I have been a little lazy.
 
Level 11
Joined
Apr 12, 2018
Messages
405
Something I noticed about the new MDX models is that they include 3 versions for LOD (level of detail) and all the geosets are effectively 'named' that way.

I don't suppose that you could append that 'name' next to the Geoset so it's easier to tell which geosets belong to what LoD? I only noticed this because of a little difficulty in separating the Mortar Team duo and delving into the MDL revealed this little tidbit (also explains why the MDX files are so flippin' huge).

====

Anyway Magos was never a tool I heavily used-- I only used it to Recalculate Extents (which I think is the only tool around that even does this) and set Cameras easy, of which no other tool is particularly good at (although even Magos is lacking in this department because you have to guess how big it'll appear in War3). Learning how to use this tool is a bit of a learning curve since I am used to a combo of Mdlvis and Notepad ++ and Mdlvis is pretty much dodo bird lately.
 
Level 15
Joined
Jul 1, 2008
Messages
1,024
@Marshmalo In general, yes. The video I posted on the previous page gives a tutorial how to set up this hacked copy of my tool. It doesn't really work well otherwise.


Also, for anybody who knows how to build from source, the online source version is ahead of the download link and I forgot to update it again. I changed out the DDS texture parser to one that is slightly faster to reduce lag.

Edit: Hopefully it won't be difficult to use. My goal is to do stuff to make it easier. But I never quite caught up with Magos in terms of features because I am so much of a Notepad++/MDL user and so I wasn't incentivized to bother with stuff like "Material Manager". I want to add those, but I have been a little lazy.

I got it to work, thanks! Tutorial was very helpful and just having a play around with it now.

However, I am just looking to simply remove the hero glow on some Reforged models, so they can be used as normal units. In classic WC3 this was simple, you just selected the vertex and deleted it.

But it appears the hero glow model is not actually included in the model unlike classic hero models. Am I right in assuming this is an attachment the reforged client automatically assigns this model?

Is it on one of the nodes and do you know how I would go about removing this?

upload_2019-12-22_13-38-4.png
 

Retera

Tool Reviewer
Level 27
Joined
Apr 19, 2008
Messages
1,183
Is it on one of the nodes and do you know how I would go about removing this?

View attachment 343178

Yes, it is now a popcorn particle node and the name is something like Hero Glow. You should be able to toggle it to become a visible dot with a particle icon, then select and delete it.

@Razorclaw_X Yes we can make that change to show the name. I am on vacation and was lazy recently, so it may be some time before I get around to changing this and publishing it. But it's a good idea, and you are totally correct.
 
Level 15
Joined
Jul 1, 2008
Messages
1,024
This is an excellent tool!

I managed to remove hero glow from Reforged models and import no problem!

The texture exporter is also extremely useful, I was also reskin and recolour the tif files. The model editor dosnt support exports to tif format, so I exported to PNG, edited the textures in GIMP then exported to tif format. Though interestingly, I had to set the texture to HD mode but the imported reforged model worked fine with the SD flag, and still had metallic reflections.

Thanks for your work on this Retera, it's great to be able to edit reforged assets :)
 
Level 4
Joined
Nov 13, 2019
Messages
47
I'm trying to export just the helmet of a Footman to use as a special effect attachment, but it's invisible in the editor and in-game.

Currently I just delete every other geoset and node except the Helmet and Hair models, go to scripts-> Assign Formatversion 800, & export as mdx.
This way I can open it in older MDX editing tools. (other methods have resulted in crash) But it still it appears invisible in editor and and ingame.

What's the proper way of doing this?

Also how does the game know what LOD to display? Is that info stored in the geoset? Is it possible that because I tried to export LOD0 it just doesn't appear because its ment for portraits?
 

Retera

Tool Reviewer
Level 27
Joined
Apr 19, 2008
Messages
1,183
Hey guys! I have not been working much on this tool during the holidays, but I just posted an update on the front page including version v0.04.2020.01.04 that includes some minor updates and bug fixes.

scripts-> Assign Formatversion 800

So, in general, the "Assign FormatVersion 800" button and the "HD->SD" buttons aren't something that I really intended to include with the tool, I just forgot to remove them in the last few releases.
They were used to make this joke video (this is running on Patch 1.26):


The point of this video is that we should not try to convert Reforged models to the old, non-Reforged format. Doing so will generally corrupt them and make a lot of stuff go wrong, since you can't express the Reforged models and their data in the old format in most cases. For example, if you convert to MDX800 and then to MDX1000, it won't be the same model. You will lose a lot of data.

Mostly those types of tools exist so that we could convert old models to the new format, since doing so actually is a more sane thing to do and is better supported by the game itself.
 

Retera

Tool Reviewer
Level 27
Joined
Apr 19, 2008
Messages
1,183
Hello, this seems to be a very cool tool, but I still wonder if it possible to change or create new animations with this? Or still WIP?

Yea, just press F to pay respect to the animation editor.

(Or click on the icon of the orange ball at the top)

The animation editor was written for SD model and it previews the bone structure but not the model, so it is still a work in progress.
You can convert the model to SD, then animate it, then import the animation back onto the HD rig and it still looks pretty good.
Just don't convert from SD back to HD in the same file -- the conversion process loses information.
 
Level 3
Joined
Oct 13, 2017
Messages
10
Yea, just press F to pay respect to the animation editor.

(Or click on the icon of the orange ball at the top)

The animation editor was written for SD model and it previews the bone structure but not the model, so it is still a work in progress.
You can convert the model to SD, then animate it, then import the animation back onto the HD rig and it still looks pretty good.
Just don't convert from SD back to HD in the same file -- the conversion process loses information.
Thanks.
 
Top