
Converting to .dat
Moderators: winston, another_commander
Converting to .dat
I've made a model for a corvette-type ship using Wings3D (first time I model anything actually), I've tried using the script obj2dattex.py but it says 'invalid syntax'. (I typed obj2dattex.py shipname.obj). What am I doing wrong?


Re: Converting to .dat
Welcome onboard Ross154 .-)
Under Windows:

1. E.g. your model (myModel.obj, myModel.mtl and myModel_auv.png) is located in D:\Mods.
2. Copy the obj2dattex.py in that folder (D:\Mods) via Explorer.
3. Open a Dos-Box (cmd.exe).
4. Type in cd d:
5. Type in cd Mods
6. Type in Obj2DatTex.py myModel.obj (or for the sloppy ones like me: obj2dattex.py myModel.py)
Under Windows:

1. E.g. your model (myModel.obj, myModel.mtl and myModel_auv.png) is located in D:\Mods.
2. Copy the obj2dattex.py in that folder (D:\Mods) via Explorer.
3. Open a Dos-Box (cmd.exe).
4. Type in cd d:
5. Type in cd Mods
6. Type in Obj2DatTex.py myModel.obj (or for the sloppy ones like me: obj2dattex.py myModel.py)
- Commander McLane
- ---- E L I T E ----
- Posts: 9520
- Joined: Thu Dec 14, 2006 9:08 am
- Location: a Hacker Outpost in a moderately remote area
- Contact:
Re: Converting to .dat
Also, the ship has an odd position and orientation. The front end should be in direction of the 'z', while the top should be towards the 'y'. Finally, the whole model should be centered around the origin.
Re: Converting to .dat
I'd also say from the screenshot that it's not been UV mapped (select the whole object and then it's the bottom entry on the right-click menu). That needs to be done to create the .mtl file and from that the texture layout.
And from the design, it's going to be an absolute bitch to map (if it's possible at all)...
And from the design, it's going to be an absolute bitch to map (if it's possible at all)...
My OXPs via Boxspace or from my Wiki pages
.
Thargoid TV
Dropbox Referral Link

Thargoid TV
Dropbox Referral Link
Re: Converting to .dat
Thanks for your tips. I had installed Python 3.x, installing 2.7 it could convert the object. By the way I don't know how to test it in game (untextured would be fine).
- MiMoriarty
- Competent
- Posts: 39
- Joined: Mon Nov 14, 2011 1:03 pm
- Location: Madrid, España
- Contact:
Re: Converting to .dat
I used a tip from Simon B.By the way I don't know how to test it in game (untextured would be fine).
Edit a standart savegame and search for this string:
Code: Select all
<key>ship_desc</key>
<string>cobra3-player</string>
After that launch Oolite and use the external views to see how it looks.
There is an art, it says, or rather, a knack to flying. The knack lies in learning how to throw yourself at the ground and miss. … Clearly, it is this second part, the missing, which presents the difficulties.
Blog http://mimoriarty.wordpress.com/
Blog http://mimoriarty.wordpress.com/
Re: Converting to .dat
The scripts are for Python 2.x . Iirc (and this may be wrong) I don't think they work with 3.x as you seem to have discovered yourself/Ross154 wrote:Thanks for your tips. I had installed Python 3.x, installing 2.7 it could convert the object. By the way I don't know how to test it in game (untextured would be fine).
My OXPs via Boxspace or from my Wiki pages
.
Thargoid TV
Dropbox Referral Link

Thargoid TV
Dropbox Referral Link
Re: Converting to .dat
Thank you all, I can see my ship in game
. How can I add textures?

- Smivs
- Retired Assassin
- Posts: 8408
- Joined: Tue Feb 09, 2010 11:31 am
- Location: Lost in space
- Contact:
Re: Converting to .dat
Hi Ross154,
You should be able to produce a diffuse_map (texture) and normal_maps etc from the modelling software. You might find my Texture tutorial on the wiki useful as well.
You should be able to produce a diffuse_map (texture) and normal_maps etc from the modelling software. You might find my Texture tutorial on the wiki useful as well.
Commander Smivs, the friendliest Gourd this side of Riedquat.
Re: Converting to .dat
As I said above I think the problem will come before your tutorial kicks in, namely UV mapping the model in Wings to generate the basic diffuse map to be textured. That model has a lot of feature details and intricate bits, which usually gives Wings a headache.
I've found a web tutorial on doing that here but as your model is so complex then you may hit problems, or at least you'll need to chop it up quite intricately to get anywhere. For me this is the most frustrating bit of model-making, as it can often take longer to get the UV map right than it did to make the model in the first place.
But once you have your map (maybe having simplified your model a bit) then Smivs' tutorial should guide you the rest of the way to getting it in-game fully.
I've found a web tutorial on doing that here but as your model is so complex then you may hit problems, or at least you'll need to chop it up quite intricately to get anywhere. For me this is the most frustrating bit of model-making, as it can often take longer to get the UV map right than it did to make the model in the first place.
But once you have your map (maybe having simplified your model a bit) then Smivs' tutorial should guide you the rest of the way to getting it in-game fully.
My OXPs via Boxspace or from my Wiki pages
.
Thargoid TV
Dropbox Referral Link

Thargoid TV
Dropbox Referral Link
Re: Converting to .dat


Thank you for all your tips


The edges are thick because I mistakenly generated the UV map with edges 2 pixels wide. Other than that it's been very nice to see it in game


- Cholmondely
- Archivist
- Posts: 5542
- Joined: Tue Jul 07, 2020 11:00 am
- Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
- Contact:
Re: Converting to .dat
I've managed to download (what are hopefully) models for space stations (pace my eternal search for stations where space-ships are constructed).
I'd like to transmogrify them into DAT files, but don't know how. And in any event, Aegidian's original converters are 32bit and my AppleMac won't allow them to run.
The contents are:
1) https://open3dmodel.com/3d-models/scifi ... 49570.html (looks as though it could be a station)
78121.blend (35mb)
78121.skp (18mb)
78121.fbx (4.3mb)
78121.mtl (2kb mtl source)
78121.obj (12.2mb)
78121.dae (8.4mb)
78121.c4d (8.3mb)
with 20 textures (.jpeg & .png) for the various sub-entities
I wonder if some of the files might be duplicates of each other in different formats.
2) https://www.cadnav.com/3d-models/model-38105.html (looks like a 3D printed model but with a possible graphics version included)
dcs-mapped max (5.4 mb)
dcs2.mtl (4kb mtl source)
dcs2.obj (8.5mb)
Lights a.gif (2kb)
lights aa.gif (1kb)
Alum panel1.jpg (700kb)
Aluminium6.jpg (700kb)
ALUM_8L4.jpg (600kb)
ALUM_8L2.jpg (600kb)
ALUM809.jpg (600kb)
Any ideas as to how I might be able to turn them into .dat files?
I'd like to transmogrify them into DAT files, but don't know how. And in any event, Aegidian's original converters are 32bit and my AppleMac won't allow them to run.
The contents are:
1) https://open3dmodel.com/3d-models/scifi ... 49570.html (looks as though it could be a station)
78121.blend (35mb)
78121.skp (18mb)
78121.fbx (4.3mb)
78121.mtl (2kb mtl source)
78121.obj (12.2mb)
78121.dae (8.4mb)
78121.c4d (8.3mb)
with 20 textures (.jpeg & .png) for the various sub-entities
I wonder if some of the files might be duplicates of each other in different formats.
2) https://www.cadnav.com/3d-models/model-38105.html (looks like a 3D printed model but with a possible graphics version included)
dcs-mapped max (5.4 mb)
dcs2.mtl (4kb mtl source)
dcs2.obj (8.5mb)
Lights a.gif (2kb)
lights aa.gif (1kb)
Alum panel1.jpg (700kb)
Aluminium6.jpg (700kb)
ALUM_8L4.jpg (600kb)
ALUM_8L2.jpg (600kb)
ALUM809.jpg (600kb)
Any ideas as to how I might be able to turn them into .dat files?
Comments wanted:
•Missing OXPs? What do you think is missing?
•Lore: The economics of ship building How many built for Aronar?
•Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
•Missing OXPs? What do you think is missing?
•Lore: The economics of ship building How many built for Aronar?
•Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
Re: Converting to .dat
Interesting. If nobody else picks this up before our next orbit of Sol, please re-bunp the thread, I might have a go.Cholmondely wrote: ↑Thu Feb 13, 2025 7:45 pmI've managed to download (what are hopefully) models for space stations (pace my eternal search for stations where space-ships are constructed).
<snip>
Any ideas as to how I might be able to turn them into .dat files?
-
- Quite Grand Sub-Admiral
- Posts: 6757
- Joined: Wed Feb 28, 2007 7:54 am
Re: Converting to .dat
You will most likely need just the *.obj, *.mtl and texture files for each model. For the first of the two it appears that the other files (.dae, .c4d etc.) are just the same model in different formats.
Once you have the files, you can use Obj2DatTexNorm.py from here to convert to .dat. You will need Python 2.7 installed for this though and I am not sure if Python 3+ will work, as this repository has not been touched for a few years now.
Once you have the files, you can use Obj2DatTexNorm.py from here to convert to .dat. You will need Python 2.7 installed for this though and I am not sure if Python 3+ will work, as this repository has not been touched for a few years now.