Page 1 of 2

Cannot convert OBJ to DAT in both Win and Linux

Posted: Thu Oct 08, 2009 6:48 am
by Commander Learner
I have installed Python 26 and tried converting an obj file to a dat file using obj2dattex.py, but it just can´t be done! I go Start-->Run-->CMD-->cd\python 26--->obj2dattex.py brick.obj-->enter--->It tells me that it could be an external command etc. What do you all do? :cry:

Posted: Thu Oct 08, 2009 6:57 am
by another_commander
I think I have seen some discussions about newer Python versions not playing very well with obj2dattex.py. You may want to try installing Python 2.4 or 2.5 and see if this helps.

Posted: Thu Oct 08, 2009 7:02 am
by Commander Learner
Thanks. And sorry about the 2 year apart post, didn't want to post a new topic about something already posted :P

Posted: Thu Oct 08, 2009 7:31 am
by Thargoid
And on Windows, you don't need to be in the Python directory to run things. Just put the obj2dat.py and your obj/mtl/png files in the same place, cd to that directory and from the command prompt do obj2dat.py <filename>.obj.

But as A_C says there are some issues with v2.6, but slightly earlier ones certainly work. Also I think I'm using (successfully) obj2dat.py, not obj2dattex.py . These of course may be the same file just with a re-name along the way somewhere...

Posted: Thu Oct 08, 2009 7:43 am
by Kaks
Yep, they all need converting to run successfully in 2.6 ( they were developed and work fine in 2.4), they're indeed different scripts, some developed earlier than others. Obj2dattex.py is slightly more complex than obj2dat, which serves as a valuable reference if you need to twiddle the converstion files...

Btw, python is an interpreted language, so those .py files are just text. If you're interested, you can edit them ( upgrade them to 2.6, anyone? ) in notepad++ already! ;)

Posted: Thu Oct 08, 2009 7:44 am
by pmw57
Thargoid wrote:
But as A_C says there are some issues with v2.6, but slightly earlier ones certainly work. Also I think I'm using (successfully) obj2dat.py, not obj2dattex.py . These of course may be the same file just with a re-name along the way somewhere...
On a related matter, I had to downgrade Python 2.6 to 2.4 due to 1.73.4 dev source tools python debug console requiring tcl8.4 :shock:

Posted: Thu Oct 08, 2009 7:56 am
by Kaks
Yep, that's why we provide the js console as a precompiled executable in windows. It neatly sidesteps most of these issues; besides, the average windows user would be stumped by having to install python in the first place... :P

Posted: Thu Oct 08, 2009 8:06 am
by pmw57
Glee! :D

This being available not from the oolite.org site, but from berlios.de instead. from http://prdownload.berlios.de/oolite-lin ... le-1.0.zip

<stimpy>Squeal!</stimpy>

Posted: Thu Oct 08, 2009 8:07 am
by Commander Learner
Another Problem (Sheesh..) Can't save shipdata file as plist.

Posted: Thu Oct 08, 2009 10:11 am
by Thargoid
Commander Learner wrote:
Another Problem (Sheesh..) Can't save shipdata file as plist.
A plist file is just a text file with a different extension. So worst case scenario make a .txt file (using a suitable editor that will write a vanilla text file without adding all sorts of hidden/special characters in it, ie not Windows Notepad) and then rename it from <foo>.txt to <foo>.plist.

Posted: Thu Oct 08, 2009 10:12 am
by Commander Learner
Isn't it Wordpad that adds all those hidden stuff? Thanks anyway. :wink:

Posted: Thu Oct 08, 2009 10:15 am
by Thargoid
No, Wordpad is fine (it's what I 50:50 use in parallel with Notepad ++) again as long as you're saving to text files of course.

It's Notepad that screws things up (mainly in relation to carriage returns and line feeds iirc).

Posted: Thu Oct 08, 2009 9:04 pm
by JensAyton
Y’know, there must be someone in the commoonity who knows their way around Python and can upgrade our various scripts. Come on, someone! There’s a listing in the illustrious Official Contributors File up for grabs!

Posted: Thu Oct 08, 2009 9:28 pm
by Zieman
Funny, I've had no problems with objtodattex.py & Python 2.6 on my machine (Win XP pro SP3).

As long as you have UV-mapped the model and have:
objtodattex.py
.obj
.mtl
.tga
in the same directory, and type objtodattex.py *yourmodel*.obj in command prompt (having navigated to correct directory there) + hit enter.

Posted: Thu Oct 08, 2009 11:18 pm
by Commander Learner
Yeah...could do it already, many ships a'coming this way. Thanks for the help everyone :D . Say, I don't see my ships anywhere in the game.....do they need a shipyard.plist file in the config or just the shipdata file?