MeshEx - .msh exportation for Gmax + XSI Mdt's

How to create models in XSI and other 3D applications and make them work in Battlefront 1 & 2. Post models, tips for application usage and share anything XSI, 3DMax, SketchUp, etc.

Moderator: Moderators

RepSharpshooter
Gametoast Staff
Gametoast Staff
Posts: 1351
Joined: Tue Jul 10, 2007 4:10 pm

MeshEx - .msh exportation for Gmax + XSI Mdt's

Post by RepSharpshooter »

Right now I'm writing a C++ program to convert yafray xml to msh. You can get a maxscript for Gmax that will export the xml. The unregistered version of 3D Object Converter can change .xsi to .xml.

Capabilities:
  • I will write just a basic mesh export system that will be only capable of exporting static buildings, but I have the capacity to add on and expand to this program.
  • I know bconstructor already does this, but I want an exporter from gmax, (also xsi if you use 3DOC) and one that doesn't involve milkshape.
Progress:
  • All the input functions are done. (verts, faces, uv, mat names, mat textures)
  • Writing polygon striping algorithm. Looking ahead and wondering what I'm going to do when I get over 256 verts, see post below
  • Currently writing binary file is next on my agenda.
Last edited by RepSharpshooter on Wed Oct 24, 2007 7:13 pm, edited 2 times in total.
User avatar
Challenger33
Lieutenant General
Lieutenant General
Posts: 726
Joined: Wed Aug 23, 2006 3:44 pm
Projects :: No Mod project currently.
xbox live or psn: No gamertag set
Location: Building a legion of papercraft models.
Contact:

Post by Challenger33 »

Well it's been about a day Rep, and still no replies. Be sure to give me it though.

-:royal:
Qdin
Old School Staff
Posts: 2059
Joined: Wed Feb 23, 2005 9:54 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Post by Qdin »

ahh - that's cool :P I hope it works.

I'd bet we've got hundreds of people sitting and cheering for you to make a good job :wink: just let it take its time (no rush from my side, and it'd look pretty good on your resume later in life :wink: )
RepSharpshooter
Gametoast Staff
Gametoast Staff
Posts: 1351
Joined: Tue Jul 10, 2007 4:10 pm

Post by RepSharpshooter »

Thank you. I have school now, and I have tons of tough classes, so I probably won't be able to finish in the near future. Maybe in a month or two. (I have at least 3-5 hours of homework that I foresee every night) But I won't give up on it. In fact, I was going to see if I could turn polygon striping algorithms into some kind of science fair project.
Qdin
Old School Staff
Posts: 2059
Joined: Wed Feb 23, 2005 9:54 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Post by Qdin »

uhh... yes...

Do your school!

not because I think studying is important or anything, I'm just a directly anti-stresser who hate stress :wink: too much homework = stress... that's why I say people should do the homwork so they can clear their minds for the important in life...

points of 3D models! :P
User avatar
swbf_lase
Major General
Major General
Posts: 647
Joined: Fri Jul 08, 2005 7:07 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: 127.0.0.1:465
Contact:

Post by swbf_lase »

Wanna shot the source code over to me?
RepSharpshooter
Gametoast Staff
Gametoast Staff
Posts: 1351
Joined: Tue Jul 10, 2007 4:10 pm

Post by RepSharpshooter »

Can I trust you with the source code? I don't want any body claiming it as their own. Also, I'm not a professional programmer, I'm an amateur. Therefore I ignore more efficient ways to do things and go for the simple route, so my code is a little jumbled. (it has a ton of comments though)

Also, will you be able to contribute to it? I know you're a programmer, but I'm not only programming, but am working with three dimensional graphics and algorithms, such as polygon stripping. If you can finish it, great! But you also need to know about the .msh format, how the vertices are stored under what tag etc etc. If you do a lot of OpenGl, you'd be fine. I'm only a beginner in OpenGl.
wazmol
High General
High General
Posts: 892
Joined: Sat Sep 02, 2006 6:47 pm
Projects :: Thinking...
Games I'm Playing :: Black Ops
Location: London
Contact:

Post by wazmol »

maybe you should think about doing this for the modtool version 6 now rather than 4.2?

just a thought

-Waz
RepSharpshooter
Gametoast Staff
Gametoast Staff
Posts: 1351
Joined: Tue Jul 10, 2007 4:10 pm

Post by RepSharpshooter »

As long as you can export .xsi, and can run the unregistered version of 3DOC, it'll work.
User avatar
swbf_lase
Major General
Major General
Posts: 647
Joined: Fri Jul 08, 2005 7:07 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: 127.0.0.1:465
Contact:

Post by swbf_lase »

Ok, I'm the lead programmer on a project called Domintuas Incendia, which is written in C++. Plus, you can defitently trust me, I think just about any GT'er would say I'm trust-worthy.
Qdin
Old School Staff
Posts: 2059
Joined: Wed Feb 23, 2005 9:54 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Post by Qdin »

Yeah - he's trustable.. otherwise I'll go make him pay.. :twisted: heh
- reminds me, don't I already owe you a beer, Lase? If you don't want it I'll keep it.. :P

seriously, though - he's not gonna do anything he'll regret - that's for sure.
User avatar
swbf_lase
Major General
Major General
Posts: 647
Joined: Fri Jul 08, 2005 7:07 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: 127.0.0.1:465
Contact:

Post by swbf_lase »

And SHADOWHAWK should be giving me some support <.<

And I forget what you owe me a beer for.... (CHecks shadowlan)...
Hunted_One

Re: MeshEx - .msh exportation for Gmax + XSI Modtools 4.2

Post by Hunted_One »

This is really neat...does this mean that if we have Gmax+4.2 mod tool (the free thing), we'll be able to export .msh? So I don't need to shell out a few thousand to buy the full version of XSI?
RepSharpshooter
Gametoast Staff
Gametoast Staff
Posts: 1351
Joined: Tue Jul 10, 2007 4:10 pm

Re: (New Question) MeshEx - .msh exportation for Gmax + XSI Modt

Post by RepSharpshooter »

So I about give up This problem is just too big for me to do in spare time. If Lase can use what I have and somehow figure out poly stripping that'd be great. I just need this problem answered.

Hey, where's all the good ol' people like Nimlot and Riley? They'd know.

My problem:
Hidden/Spoiler:
Hopefully. I'm going to try and at least write up to the polygon stripping algorithms on my own, and then give it to lase.
I'm getting close to actually having an algorithm working, but looking ahead, the .msh file format uses a short int array to store info about the strips. It's kind of confusing.

From http://personal.riley-man.com/swbf/edit ... f-msh.html
[quote]STRP (exactly one)
Polygon strips. The first 4 bytes stores a single 32-bit integer specifying the number of 16-bit integers that follow. The remaining data stores 16-bit integers that act as the index buffer. Values with the highest bit set (0x8000) indicate the beginning or end of a polygon.

Data
Type Size (bytes) Description
int 4 Number of 4-byte groups that follow.
short[] 2 each --Index into list of vertices (POSL section). If the highest bit is set, it means this is the beginning or end of a polygon.[/quote]

So it's a short array, the hex for it looks like:
00 80 01 80 02 00 03 00 (I recalled this out of my head, check a .msh just in case)

It seems there's always two 80's at the beginning

So it seems 80 marks the beginning of a new poly strip, but what happens when you get over 256 verts? FF 81? I can't find an example of a mesh with one. The mesh is broken into segments, which usually don't go over 256. Anyone please help.
wazmol
High General
High General
Posts: 892
Joined: Sat Sep 02, 2006 6:47 pm
Projects :: Thinking...
Games I'm Playing :: Black Ops
Location: London
Contact:

Re: (New Question) MeshEx - .msh exportation for Gmax + XSI Modt

Post by wazmol »

so your stuck eh?

i wish you could get this to work but meh i have the full xsi anyway...

just wanna wish you luck!

-Waz
RepSharpshooter
Gametoast Staff
Gametoast Staff
Posts: 1351
Joined: Tue Jul 10, 2007 4:10 pm

Re: MeshEx - .msh exportation for Gmax + XSI Mdt's

Post by RepSharpshooter »

Well, I've resumed work on it again :)

Skipping the polygon junk and just getting the binary file stuff out of the way. Oh and I solved that problem, it means it does this:
10000000
wazmol
High General
High General
Posts: 892
Joined: Sat Sep 02, 2006 6:47 pm
Projects :: Thinking...
Games I'm Playing :: Black Ops
Location: London
Contact:

Re: MeshEx - .msh exportation for Gmax + XSI Mdt's

Post by wazmol »

good to know you have resumed work on this!

-Waz
MandeRek
Sith Master
Sith Master
Posts: 2766
Joined: Tue Oct 02, 2007 10:51 am
Projects :: Battlefront Zer0
Games I'm Playing :: SWTOR
xbox live or psn: No gamertag set
Location: Ghosting around GT
Contact:

Re: MeshEx - .msh exportation for Gmax + XSI Mdt's

Post by MandeRek »

Wow Rep! I think we all hope you finish this soon! Especially the ones with the full version of XSI, then they don't get the "Can you convert this for me pleas?" question anymore :D

Great idea!

MandeRek
RepSharpshooter
Gametoast Staff
Gametoast Staff
Posts: 1351
Joined: Tue Jul 10, 2007 4:10 pm

Re: MeshEx - .msh exportation for Gmax + XSI Mdt's

Post by RepSharpshooter »

I made a lot of progress today. The polygon stripping algorithms are roughed out (They don't work for crap though, lol I have to debug)

And I just realized that 3DOC doesn't keep uv's when saving to yafray xml. Oh well. Guess it's for gmax only, lol.

Well I might write a .obj import feature, but at the moment I care more about it exporting the mesh correctly. I favored the .xml because it kept material information.

Well ,I'll try to debug these algorithms, then guess what? All that's left to do is group the polygon strips into mesh segments then write them in binary! Shouldn't be too difficult once I get the stripping blah done.
wazmol
High General
High General
Posts: 892
Joined: Sat Sep 02, 2006 6:47 pm
Projects :: Thinking...
Games I'm Playing :: Black Ops
Location: London
Contact:

Re: MeshEx - .msh exportation for Gmax + XSI Mdt's

Post by wazmol »

wow so you will be releasing pretty soon or not? (that sounded like one of them very n00bish and annoying questions)

so tell me how this works?

do you make your model in Gmax or XSI Modtools then you export as something (for example ObJ) then with your new program you import the Obj and export it as a Msh?

is that right or am i missing something?

-Wazmol
Locked