3DMAX MSH Exporter

Timbab

Administrator
Staff member
Administrator
Moderator
Oct 6, 2010
1,044
40
48
28
Magna Germania
#21
I just realized this won't work for armor, right? Because they're mgn, bah. I tried, but I just now realized it.

Unless I'm wrong, is there a chance you'll be working on a MGN exporter?
 

Aigik

New Member
Sep 16, 2010
27
0
0
#22
I have a small suggestion for the UI... When you are working with large objects like structures that use multiple shader files, it can be both frustrating and time consuming because every time you make a change and want to re-export the model, you have to retype all of the shader names. I suggest that the default shader names are not "shaderName.sht", but instead should be named after the object. That way I can name each object and not have to retype those every time I export.
 

Timbab

Administrator
Staff member
Administrator
Moderator
Oct 6, 2010
1,044
40
48
28
Magna Germania
#23
On a different note to what I said above, would you be able to help me figure out how to remap the textures of a mgn (armor for example), even if there is no mgn exporter? What I mainly need is the ability to remap the UV's so I can eliminate the stretch and mirroring.
 

rosuto

New Member
Aug 1, 2011
69
1
0
#24
The msh and mgn wont work together, and I probably wont be focusing on it for a while. Still need to hammer out this lighting issue and the rest of the SHT file as it relates to MSH files. Now as for helping you figure out from what I already know, that I can do. How I export the MSH models is that I pretty much ignore the model and focus entirely on the UV map. Now this could be why I have lighting issues and if so, will have to be tweaked in the future. But it gives the user the greatest flexibility when designing. Now what you are going to run into is that you can move uv maps around all you want, but as soon as you create or take away verts, you are going to have an issue. Thus why you are probably going to need an exporter, not just to pull the info out, but to recreate what you see into a proper MGN file. Think I spent like 6hrs studying a cube, trying to figure out how in the world 8 verts and 12 faces, and a texture went together. The good news is that fatducks importer does import mgn into 3d max, and if we knew what needed to be pulled out and how it was organized, we could do that and assemble it with Tre explorer until a proper exporter comes along. The bad news is that I know nothing about MGN right now, but thats how I started off 6 weeks ago with the MSH.

Aigik- I put on your suggestion. It was one line of code and probably one of the easiest things I have done, thats why 1.32 is up. Also if you put the textures into the uv editor and do not collapse the stack, it will pull them into the sht creator.

This will probably be the last update for a few days. I ripped the effects out of the SHT files and am going to try and correlate them with the texture codes. If it does pan out, I will add around 85 effects and filter them depending on which texture codes are chosen. This should limit crashing from choosing the wrong effects, but will take some time to code in. Lets see... Im at 1,831 lines of code right now. Any guesses what it will be after Im done?

Texture stretching- I will probably have to hand map the uv coords from a MSH model to figure out whats the deal. What I do know is that the original MSH files did not usually use the same UV coords for each channel. May or may not be related, but I will look into it.
 

Timbab

Administrator
Staff member
Administrator
Moderator
Oct 6, 2010
1,044
40
48
28
Magna Germania
#25
I appreciate you looking into it, there maybe be hope yet.

All I really care for at the moment is UV maps and textures, trying to get the best out of the models that exist at the moment, but your exporter should make it possible to redo most of the static stuff at least, like equipment, weapons, environment, etc.

I currently don't have the time or mind to really dig deep, otherwise I'd try to contribute.
 

rosuto

New Member
Aug 1, 2011
69
1
0
#26
I think I just get carried away sometimes, lol. Its a good thing I actually slowed things down a bit the past couple of days and started doing actual testing before the next release. Updated the gui code base so its a bit faster. Been getting rid of bugs and putting in more user error coding. Also think I have figured out the vertex coloring, or atleast am getting closer.




So this is what I think I know

Basics: MSH --> SHT --> EFT --> Vertex and Pixel Shaders
Textures: SHT --> EFT --> Vertex and Pixel Shaders
Vertex Colors: MSH --> EFT --> Vertex and Pixel Shaders

So if this actually pans out it does a few things
1) Solves most of the lighting issues
2) Allows people to create new effect files in the future

Now I will probably do MGN before I even think about effects, because the effects, vertex, and pixel shaders are all linked together. Screw up one, and none should work, or atleast thats what I think. This is why if you pick the wrong effect, you get an invisible object. The vertex and pixel shaders are looking for something that doesnt exist.
 

Aigik

New Member
Sep 16, 2010
27
0
0
#27
Oh god yes. When can we expect a new release with those lighting fixes? ;)

Having a fix for the lighting issues will finally allow me to see the fruits of my labor in-game.
 

rosuto

New Member
Aug 1, 2011
69
1
0
#30
Thanks DavinFelth, the model is on loan from Aigik so I could figure out the lighting effects.

Ok, so the lighting. What I said a number of posts ago is still true, I was just missing a very curical piece of the puzzel, the effect.

So if you don't like the way SWG lights your objects, and I totally dont blame you, you need to add a vertexpaint modifier to your object. Throw in a color, perferably grey scale, and this is going to take a bit of experimenting to see if you can paint the whole thing one color and which color to use.

Fast forward to the SHT file creator. I have pulled every known effect code related to MSH files and added it in. There are 3 basic codings: A, C, and H. So the effects looks like A_simple.eft or C_simple.eft. Choose the C coded effects if you use vertexpaint to see it in game. Now to get the effect is a little bit of a puzzle. For single texture objects, just put a 0 in the TCSS box and the effects drop down list will fill up. For other texture codes and the effects that link to them, please look here.
 

Aigik

New Member
Sep 16, 2010
27
0
0
#31
You were able to get that crate in-game with the lighting working properly, but I still can't do it. Is that not in the newest version or is there something I'm doing wrong?
 

rosuto

New Member
Aug 1, 2011
69
1
0
#32
Lets see if this helps. Else we are going to have to figure it out in like 12hrs because I've got to get some sleep (1am).

Youtube Video

Pretty much I just opened the file you gave me and did what is in the video to it. And at the end I open up SWG and get the pics that are posted on the previous page. Fraps didnt seem to want to follow me there, lol.
 

rosuto

New Member
Aug 1, 2011
69
1
0
#35
Thanks, Im hoping Aigik can give me a thumbs up on being able to repeat my results. In the mean time I have started to tackle the attachment points for MSH models. Managed to throw myself out of my house and 46 gazillion meters away from the chair I sat down in, lol. I figured out a couple of things but I am going to hit up Uli to see if I can get more specifics without trial and error. Once its working this will be an interesting feature to test out, since its a client mod that changes the players position.
 

Aigik

New Member
Sep 16, 2010
27
0
0
#36
rosuto said:
Thanks, Im hoping Aigik can give me a thumbs up on being able to repeat my results. In the mean time I have started to tackle the attachment points for MSH models. Managed to throw myself out of my house and 46 gazillion meters away from the chair I sat down in, lol. I figured out a couple of things but I am going to hit up Uli to see if I can get more specifics without trial and error. Once its working this will be an interesting feature to test out, since its a client mod that changes the players position.
Hey, sorry I didn't get back to you, I was busy yesterday with friends from out of town. Anyway, yes, it worked, the video helped a lot. Turns out what did it was using c_simple instead of a_simple. For some reason a_simple would not export the vertex paint properly. Any idea why? I'll use a_simple for now instead. The lighting works and it looks great. I'll make a thread with screenshots later this week, maybe tomorrow, since I have another busy day today. Thanks again.
 

rosuto

New Member
Aug 1, 2011
69
1
0
#37
Thats what I thought it was, hence why that was one of a few pauses in the video.

I ripped all the codes based on if they used vertex coloring or not (vertexPaint). Basicly if you use vertex paint, use the c_xxxxx, if you dont want to use vertexPaint, then use the a_xxxxx. Im split on coding it so that if you use vertex paint, then you have to use the c_xxxx. Main reason is that it can be difficult to figure out what effects are available for the textures you are using. Not all of them have an a_xxxx and a c_xxxx. And the manual I put up of how the codes go certainly isnt easy to memorize. As for the h_xxxx, it seems to be a darker version of a_xxxx, so it ignores vertexPaint also.
 

Aigik

New Member
Sep 16, 2010
27
0
0
#38
rosuto said:
So if this actually pans out it does a few things
1) Solves most of the lighting issues
2) Allows people to create new effect files in the future
Is there anything more you can tell us about that second point? The effect that's really missing from this game is an effect that combines an envmask with a normal map. I'd love to be able to create this. If you figured this out, what would go into creating a new effect?
 

rosuto

New Member
Aug 1, 2011
69
1
0
#39
So say want to be able to use a diffuse, envmask, and a normal together. So you create the model with 3 uv maps and code that into the shader. Next step is to have an effect that is coded for those three things. The effect file also links to a vertex shader file and a pixel shader file. Now the effect file is another iff file, so we can create another file creator for it once it is figured out. The problem mostly lies with the vertex and pixel shaders which are written in HLSL. Now Timbab knows more about this than me, so he is probably the one to go to. But if we are lucky, its all about finding the data that we need from other files and putting a new file together. Microsoft has a couple of examples and SWG mostly follows it, so hopefully its not big leap.

If this ever gets off the ground, one nice thing to have would be an effect/vertex/pixel library for the community.
 

rosuto

New Member
Aug 1, 2011
69
1
0
#40
I've been searching for the file that the attachments links to but havent been able to find it. Some where there has to be something that the attachment calls that says allow this ability for this object, and play this animation when doing it.

Other news is that I have added in apt file creation. This will allow you to bypass LOD files if you use the default model file. It will also need to be used when adding attachments to files that use LODs, else you have to edit the LOD attachment. I've started looking at the MGN format. Good news is that I know where the basic modeling components are; verts, faces, normals, and UV. The bad news is that the format is not the base, so will have to start else where. Im thinking its the skeleton file.

Ive also found interesting odds and ends like "george lucas" is listed in the profanity filter. More effect files to go through and add to the list. Though Im going to try to learn how to read the eft files instead of finding a sht file that tells me what it does. So going to take a bit of time. How to play with the fog level. Can even turn the cantina into a rave, lol.