Aller au contenu

Photo

Model file formats


45 réponses à ce sujet

#1
ChewyGumball

ChewyGumball
  • Members
  • 282 messages
I know there is a specification for both MMH and MSH files on the wiki but does anyone have a concrete example of one that contains actual data? I would like to get a better understanding of the formats and I find the xml outlines rather... lacking, especially the wall of text that is the MMH page.

Also, I have not found a real discussion on this kind of thing which leads me to believe there isn't one. If there is, would someone please point me to it? If not, I say we make a place for one, say this thread for example.

#2
ChewyGumball

ChewyGumball
  • Members
  • 282 messages
I have hopefully created an outline for a valid MSH file, however i can't get the compiler to successfully compile it :(
This is my outline, I have tried it with various different attributes/data and nothing has worked, not even a helpful error message from the compiler.

<?xml version="1.0" encoding="UTF-8"?>
<ModelMeshData name="string" Version="int">
  <!-- must have 0 or more of these, obviously having at least 1 would be required for being useful -->
    <MeshGroup name="string"><!-- optional attributes: Optimize="string"<< all,none, or indicies -->
      <!-- must have at least 1 of these -->
      <!-- I believe each separate data element contains data of the type specified in Semantic
            --dont know what default behaviour is when Semantic is not specified--
           for instance, first will hold all vert data, second hold normals, third hold triangle indecies etc
       -->
        <Data>
        <!-- optional attributes:
            ElementCount="int"  -- If semantic is not "indices", this is the number of tuples in the CDATA.
            IndexCount="int" -- If semantic is "indices", this is the number of integers in the data's CDATA.
            IndexType="string"> -- Every example of this has the value "Index32", without exception.
            Semantic="string" -- "POSITION", "Indices", "TEXCOORD", "TANGENT", "BINORMAL", "NORMAL", "BLENDWEIGHT", "BLENDINDICES"
            Type="string" -- indicates how many elements and of what type are in the tuples in the CDATA.
                             "Float4" (four floating point numbers), "Float2" (two floating point numbers), "Short4" (four integers)
        -->
        data <!-- contains CDATA with tuples of numbers. For example, a Float2 type MSH had this: <![CDATA[0.195959 0.999994 0.195959 0.266686 0 0.266683 0 1. 0.999999 0.999994 1. 0.166668 ]]> -->
        </Data>
    </MeshGroup>
</ModelMeshData>


Modifié par ChewyGumball, 11 novembre 2009 - 02:51 .


#3
jsog

jsog
  • Members
  • 106 messages
I'm going to subscribe to this post, I've been wanting to try to edit some models a slight bit... I'm no real artist, but I can do some modification well enough.

#4
Adinos

Adinos
  • Members
  • 341 messages
I have a few valid XML files I got from BioWare under the beta NDA - but I'm not sure if I'm allowed to redistribute those files.

At the time I got the files, they were useful to get some missing information, but that information (the usage/type enums), has now been added to the MSH wiki page.

The only real use for the XML files is if anyone is writing a model import tool that will convert from some 3D format to the XML format - as for really understanding the model format, I found it more useful just to look at the binary files.

Modifié par Adinos, 11 novembre 2009 - 11:56 .


#5
ChewyGumball

ChewyGumball
  • Members
  • 282 messages
I would very much like to create a tool that could convert from common 3d filetypes to the proper XML specifications to be compiled. Theres two impediments really, me not having a proper xml file that compiles to base any creation I have on, and the compiler not giving ANY helpful messages when there is an error.



I have also thought that it might be easier to just make a converter that would take a .obj for example and spit out a straight MSH file. Unfortunately I'm not so adept at backwards engineering to be able to understand a MSH file farther than what the editor shows when I open one up.

#6
ChewyGumball

ChewyGumball
  • Members
  • 282 messages
I have done the same to the MMH schema:
EDIT: Apparently its too long/wide to format decently here, and I cant seem to find a place to upload a file anywhere. I'll get back to you with the actual file...
EDIT2: I created a project and uploaded a .rar with the formats from the wiki and my example xml files

I have also added a few comments of my own on some parts, some guessing what parts are for, others clarifying how many elements are required or optional.

PLEASE NOTE: I have not actually compiled anything successfully yet, hopefully once I do I will get more insight into the actual structure of a valid file.

Also, Adinos:
Kinda sucks that you're under an NDA with those files :((( I'll take any insight you can give without distributing them,  though.

Modifié par ChewyGumball, 12 novembre 2009 - 07:28 .


#7
Adinos

Adinos
  • Members
  • 341 messages
Well, I may be allowed to give you the files - I just have to check - I was also thinking of adding a feature to my model tool, to export the models to the XML format.

#8
ChewyGumball

ChewyGumball
  • Members
  • 282 messages
If its at all possible I would love a peek at them, I do understand if thats not possible though.

#9
BryanDerksen

BryanDerksen
  • BioWare Employees
  • 273 messages
Go ahead and pass them around, Adinos. In fact, I just did some asking around and was given the go-ahead to release a bunch more. I'll put together another package with a wider variety of models for your reverse-engineering pleasure and stick them up in a project for download when I've got the time (maybe tomorrow, weekend definitely).

#10
ChewyGumball

ChewyGumball
  • Members
  • 282 messages
Awesome!

#11
ablaine

ablaine
  • Members
  • 37 messages
Sweetness.

#12
Adinos

Adinos
  • Members
  • 341 messages
OK, here they are: http://social.biowar...oject/41/#files Just grab sample_xml_files.zip and enjoy.

It's reasonably easy to convert from many 3D formats to this XML format, and combined with BioWare's tools to create the MSH/MMH files, it should give you a functioning import tool.

Modifié par Adinos, 13 novembre 2009 - 11:15 .


#13
ChewyGumball

ChewyGumball
  • Members
  • 282 messages
Thanks for uploading them! I seem to be doing something wrong though. When I run the GraphicsProcessorMSH.exe it sucessfully compiles the .mmh.xml files but not the .msh.xml files. I haven't touched any files at all, they are straight from the zip.

So far I have been able to get my own MMH to work, and I have an empty bounding box that I can place anywhere I like in a level. It just references a msh file that doesn't exist :(

#14
Adinos

Adinos
  • Members
  • 341 messages
Hmm...not sure what is wrong. Are you sure you are running the right program - GraphicsProcessorMSH.exe vs. GraphicsProcessorMMH.exe ?

#15
ChewyGumball

ChewyGumball
  • Members
  • 282 messages
I'll outline what I did:
1.Open cmd and navigate to the export_processors folder
2. run GraphicsProcessorMSH.exe -outdir testing -indir testing (i made a new folder containing an mmh.xml and msh.xml called testing in the same directory ie export_processors\\testing)
3. It says Sucessfully processed 1 files
4. there are the original xml files along with a mmh file and a phy file

I tried it with the GraphicsProcessorMMH.exe as well and the same thing happens. Might it be that its just the same program renamed different things by accident?

Modifié par ChewyGumball, 13 novembre 2009 - 09:07 .


#16
FalloutBoy

FalloutBoy
  • Members
  • 580 messages
Does this include the file format for head morphs?


#17
ChewyGumball

ChewyGumball
  • Members
  • 282 messages
I do not believe so, these files are to do with representing a model and its structure. It may make reference to morphs somewhere, I have not looked too closely at what is referenced, but they would be references only, not definitions.

#18
Adinos

Adinos
  • Members
  • 341 messages
Models basically consist of a MMH and MSH file, but head morphs are stored in a different way. There is a "base" head among the models, though - see these screenshoys from the model browser:



Posted Image

#19
ChewyGumball

ChewyGumball
  • Members
  • 282 messages
Been a bit busy with school, but I have managed to get msh files to compile. Apparently, GraphicsProcessorMSH will compile mmh files unless the option mmdtogff is used, in which case it will compile msh files as well. 

EDIT: Making a converter from some file formats to the required msh format doesn't really seem too hard. I just have to find the time to do it :o 

Modifié par ChewyGumball, 17 novembre 2009 - 04:58 .


#20
ablaine

ablaine
  • Members
  • 37 messages
So we may have a working import soon? Or is that still in the near future? :)

#21
ChewyGumball

ChewyGumball
  • Members
  • 282 messages
Doesn't soon and in the near future mean the same thing? Depending on how optional some of the optional parts of the format are, a working prototype should be quick to whip up. In the worst case I will have to brush up on some linear algebra though, nothing super rough I hope.

Modifié par ChewyGumball, 17 novembre 2009 - 05:19 .


#22
ablaine

ablaine
  • Members
  • 37 messages
Haha I suppose they do.

#23
Adinos

Adinos
  • Members
  • 341 messages
I uploaded more xml files I just got from Bryan Derksen, so you now have files for creatures (ok, the nug), weapons, and various other things - located at the same place as before.



I believe the samples should be sufficient for anyone wanting to write a converter that writes the xml files.

#24
tazpn

tazpn
  • Members
  • 70 messages
Thanks for posting them (though they are still hidden on the site). We really only need like one example of some of the more simple and complex objects. I've made good progress on my exporter but still unsure about skeletons and more complex hierarchies and the nug would be very useful there as a sanity check.

#25
Qkrch

Qkrch
  • Members
  • 128 messages
Good luck with it tazpn!



Sweet news indeed