About ODF models.

Started by Inkognito, July 12, 2012, 12:31:43 AM

Previous topic - Next topic
So guys i have a question about: How i can convert ODF to 3ds max? And then how can i convert it back to ODF?
Will be great if someone help's me.
-Thanks!-

ODF files are just text documents that describe various elements of objects in the game.

The actual models are .msh files, and there are few conversion options for the format.
Getting them into 3ds max would be via conversion to obj or VRML, then importing that.

There is a program that converts to obj format. ( meshtool , I believe the latest is meshtool4 , I don't have a link for it at the moment, sorry )

And the MSH Viewer can export to VRML (I believe it is VRML 2.0) (link)

None of the converters I have heard of preserve the nulls/bones/hard points of the source msh.
:(

Most modelers for SWBF use XSI SoftImage or thier free Mod Tool.
But even they don't have a msh importer, and exporting from the Mod Tool is acomplished via the ZETools plugin for it. ANDEWGET has the current status of the plugin at that link.

Ok , thanks for unswer. And dont laugh if i am have mistake in something , i just trying to figure out how a game constracted now.
-Thanks!-

Thanks for asking.
Don't be shy about asking questions. Thats how we learn. :)

There are several documents in the \BFBuilder\Documentation\ folder of the SWBF Mod tools(link)
They explain a lot(including a getting started example) about the Star Wars Battlefront modding process.

Tirpider , i have model in 3DS max. And ye as you said it is no bones there. But if i'll make my own bones?Maybe it is same system of animation as in Warcraft 3? How you think?

I'm pretty sure the bone/null structure is going to be different with Warcraft 3 models.
(I haven't seen them so I don't "know", but it's a safe bet that they aren't the same.)

I have worked with the unit bones a bit, but only via hex-editing and experimentation. Nothing fantastic yet.

What I do have is:
a logical layout of how the bone's are connected (link)
a standard unit skeleton in Milkshape3D Ascii format (link)
a basic breakdown of the msh format (link)

But I have yet to produce a new or modified animation that works in-game.
To my knowledge, the best approach to this is to use the free version of SoftImage ModTool (link) and ADEWGET's msh exporter (XSI ZETools (link) .) I don't believe it does animations yet, but I know he is close implementing them.

He also has a description of the msh format, layed out in a bit different manner. (link)
We started reversing the format about the same time, but have different approaches toward appying the information. It might help to see things from different points of view. (It helped us :) )

That and a few theroies pretty much describes what I know about msh files.
I don't know how to make bones in 3DS max, but a great head start would be to take a look at that Milkshape3d Ascii file. The bones/null positions and rotations are perfectly described there. It might help when constructing your 3DS max skeleton.

Getting them back out of 3DS max might be another thing. I don't know of any msh exporters for 3ds max. I have read about (no link) converters that convert to obj, but any time a msh passes through the obj format, it looses all the nulls and bones as the format can't store them.

I'm working on a walkthrough for using some tools I built for hacking the format. My reason for hacking it was because I could not find a way to edit existing models and preserve the internal structures that made them animate.
My method works, but it's still a limited hack and doesn't allow for actual 3d mesh creation. It's mainly for kitbashing and part swapping/addition/removal. ((link to unfinished walkthrough))

I know this all seems like dead-end type stuff, I hope that doesn't discourage you. Folks have been able to get working units built and into the game, but it seems that every one has had to create thier own method to get it in so that it works.

You see , i have expirience with working on 3DS max.I know how to create skeleton for model. I know how to make animation. But problem is that: In Warcraft 3 i made animation in such way like - imagine all timeline of animation , so from 0 to 5 sec for example on time line it is walk animatin , from 5 to 8 it s attact animation etc. So question is that: Is its same in SWB? I think yes. But Maybe you know more about this.
-Thanks!-

And yes , one more , do you have some exporter that could export model from 3ds. to msh? Cuz as i see VRML dont have bones , so it will be not animated in game.
-Thanks!-

Ok so about exporting from 3ds to msh. .
All i can say that this scripts helps :
rollout roll_expmesh "Export Mesh"
    (
      edittext edt_path "Path" pos:[10,10] width:300
      button btn_Browse "Browse" pos:[320,10] width:50
       button btn_exp "Export"
       checkbox chk_v "Vertex" checked:true 
      checkbox chk_n "Normal" checked:true
      checkbox chk_f "Face" checked:true
      checkbox chk_t "Texture" checked:true
     
      on roll_expmesh open do 
      (
      s=selection[1].name as string
        edt_path.text=(GetDir #Export)+"\\"+s+".msh"
      )
      on btn_browse pressed do
      (
      s=GetSaveFileName types:"Mesh file (*.msh)|*.msh|All files (*.*)|*.*"
        if s!=undefined do
        (
          edt_path.text=s
        )
      )
      on btn_exp pressed do
      (
      local bV=0     
        local bN=0     
        local bF=0     
        local bT=0     
       if chk_v.checked==true then bV=1
        if chk_n.checked==true then bN=1
        if chk_f.checked==true then bF=1
        if chk_t.checked==true then bT=1
       if edt_path.text!=undefined do
          (
        file01=createFile edt_path.text
         format "% " bV to:file01
            format "% " bN to:file01
            format "% " bF to:file01
            format "%\n" bT to:file01
          local vnum=getNumVerts selection[1].mesh
          local fnum=getNumFaces selection[1].mesh
          local tnum=getNumTVerts selection[1].mesh
          format "% " vnum to:file01
            format "% " fnum to:file01
            format "%\n" tnum to:file01
          mesh01=snapshotasmesh selection[1]

           
            if chk_v.checked==true do
            (
         format "vertex \n"  to:file01
              for j=1 to vnum do
              (
                local p01=[0,0,0]
                p01=GetVert mesh01 j
                format "% " p01.x to:file01
                format "% " p01.y to:file01
                format "%\n" p01.z to:file01
              )
            )
            if chk_n.checked==true do
            (
         format "normals \n"  to:file01
              for j=1 to vnum do
              (
                local p01=[0,0,0]
                p01=GetNormal selection[1].mesh j
                format "% " p01.x to:file01
                format "% " p01.y to:file01
                format "%\n" p01.z to:file01
              )
            )
            if chk_f.checked==true do
            (
          format "Faces \n" fnum to:file01
              for j=1 to fnum do
              (
                local p01=[0,0,0]
                p01=GetFace selection[1].mesh j
             x01=(p01.x-1) as integer
                y01=(p01.y-1) as integer
                z01=(p01.z-1) as integer
                format "% " x01 to:file01
                format "% " y01 to:file01
                format "%\n" z01 to:file01
              )
            )
            if chk_t.checked==true do
            (
         format "texture_vertex \n"  to:file01
              for j=1 to tnum do
              (
                local p01=[0,0,0]
                p01=GetTVert selection[1].mesh j
                format "% " p01.x to:file01
                format "% " p01.y to:file01
                format "%\n" p01.z to:file01
              )
              format "texture_face \n" fnum to:file01
              for j=1 to fnum do
              (
                local p01=[0,0,0]
                p01=GetTVFace selection[1].mesh j
                x01=(p01.x-1) as integer
                y01=(p01.y-1) as integer
                z01=(p01.z-1) as integer
                format "% " x01 to:file01
                format "% " y01 to:file01
                format "%\n" z01 to:file01
              )
            )           
            close file01
          )
      )
    )
   if selection.count<1 then MessageBox "Select object"
    if selection.count==1 do
    (
   m_roll=newrolloutfloater "JSD Exporter" 400 600
    addrollout roll_expmesh m_roll
    )
So now problem to put model with it bones and all elements to 3DS max.

Looks cool, Inkognito!

I suspect tirpider may be able to make use of that.  :cheers:
Quote from: Abraham Lincoln. on November 04, 1971, 12:34:40 PM
Don't believe everything you read on the internet

That looks like a start for an export script.
It looks like it is grabbing verts (POSL), normals (NRML), face (polygons, NDXL, NDXT, STRP), and texture (UV0L) information, but I don't see where it is encoding foats, building MODL chunks or even defining materials. I'm guessing it exports a different msh format. (There are many games and applications that use the msh extention, and they all have a different structure.)

The links in my previous post have file structure, byte encoding, and size requirements for the msh files.

A good place to start would be to compare msh structures with equivalent 3DS structures ands see what the differences are.
There will be places where your application expects more info than the format provides, so you will have to find ways around that.
There will be other places where the msh has stuctures that don't exist in 3DS. You will have to find workarounds for that as well.

I don't have a copy of 3ds max, and have no experience with it at all.
I would encourage you to take a look at the Softimage Mod Tool. There are links to various sources for it (including a 3ds importer) over on GameToast (GT - Free Autodesk Softimage 7.5 Mod Tool software)
Thier 3D modeling forum is a bit stronger than ours at this time.

A possible pipeline for you would be to use 3ds max to produce your model, then get it over to Softimage to envelope, animate and export it.
I know that the XSI ZETools plugin doesn't quite support animation yet. From browsing the forums on GT it seems that folks have been requesting others to export the file from thier older (now unavailiable) copies of XSI.

I know that isn't a lot of help. But getting bones into and back out of 3ds is going to be a big adventure. One that I don't have many answers for beyond describing the msh format in general.