Page 1 of 1

Converting to .dat

Posted: Thu Feb 02, 2012 8:36 pm
by Ross154
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?

Image

Re: Converting to .dat

Posted: Thu Feb 02, 2012 9:31 pm
by Svengali
Welcome onboard Ross154 .-)

Under Windows:
Image
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)

Re: Converting to .dat

Posted: Thu Feb 02, 2012 10:09 pm
by Commander McLane
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

Posted: Thu Feb 02, 2012 10:23 pm
by Thargoid
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)...

Re: Converting to .dat

Posted: Fri Feb 03, 2012 9:23 am
by Ross154
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).

Re: Converting to .dat

Posted: Fri Feb 03, 2012 10:41 am
by MiMoriarty
By the way I don't know how to test it in game (untextured would be fine).
I used a tip from Simon B.

Edit a standart savegame and search for this string:

Code: Select all

	<key>ship_desc</key>
	<string>cobra3-player</string>
Then change "cobra3-player" for "yourship-player" and save. Where yourship it's the name you have defined in the shipdata.plist.

After that launch Oolite and use the external views to see how it looks.

Re: Converting to .dat

Posted: Fri Feb 03, 2012 12:22 pm
by Thargoid
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).
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/

Re: Converting to .dat

Posted: Fri Feb 03, 2012 1:46 pm
by Ross154
Thank you all, I can see my ship in game :). How can I add textures?

Re: Converting to .dat

Posted: Fri Feb 03, 2012 3:16 pm
by Smivs
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.

Re: Converting to .dat

Posted: Fri Feb 03, 2012 7:28 pm
by Thargoid
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.

Re: Converting to .dat

Posted: Sat Feb 04, 2012 7:42 am
by Ross154
Image

Image

Thank you for all your tips :) I managed to apply some textures (not original, you'll recognize them, it's just to try it :)).

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 :). I have yet to understand a couple of things in Wings3d (material and texture handling for different parts of an object) but I found a workaround for this ship that made things easier for me :). Textures can be improved.. (top column above all..). The engine glow wasn't in the right position so I shut it down.