Cannot convert OBJ to DAT in both Win and Linux

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

User avatar
Commander Learner
Dangerous
Dangerous
Posts: 123
Joined: Thu Aug 20, 2009 12:08 pm
Location: Somewheeeeeere over the rainbooooooooooow~

Cannot convert OBJ to DAT in both Win and Linux

Post 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:
Shooting polygons since 2001
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6683
Joined: Wed Feb 28, 2007 7:54 am

Post 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.
User avatar
Commander Learner
Dangerous
Dangerous
Posts: 123
Joined: Thu Aug 20, 2009 12:08 pm
Location: Somewheeeeeere over the rainbooooooooooow~

Post 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
Shooting polygons since 2001
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Post 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...
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Post 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! ;)
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
pmw57
---- E L I T E ----
---- E L I T E ----
Posts: 389
Joined: Sat Sep 26, 2009 2:14 pm
Location: Christchurch, New Zealand

Post 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:
A trumble a day keeps the doctor away, and the tax man;
even the Grim Reaper keeps his distance.
-- Paul Wilkins
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Post 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
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
pmw57
---- E L I T E ----
---- E L I T E ----
Posts: 389
Joined: Sat Sep 26, 2009 2:14 pm
Location: Christchurch, New Zealand

Post 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>
A trumble a day keeps the doctor away, and the tax man;
even the Grim Reaper keeps his distance.
-- Paul Wilkins
User avatar
Commander Learner
Dangerous
Dangerous
Posts: 123
Joined: Thu Aug 20, 2009 12:08 pm
Location: Somewheeeeeere over the rainbooooooooooow~

Post by Commander Learner »

Another Problem (Sheesh..) Can't save shipdata file as plist.
Shooting polygons since 2001
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Post 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.
User avatar
Commander Learner
Dangerous
Dangerous
Posts: 123
Joined: Thu Aug 20, 2009 12:08 pm
Location: Somewheeeeeere over the rainbooooooooooow~

Post by Commander Learner »

Isn't it Wordpad that adds all those hidden stuff? Thanks anyway. :wink:
Shooting polygons since 2001
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Post 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).
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post 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!
User avatar
Zieman
---- E L I T E ----
---- E L I T E ----
Posts: 680
Joined: Tue Sep 01, 2009 11:55 pm
Location: in maZe

Post 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.
...and keep it under lightspeed!

Friendliest Meteor Police that side of Riedquat

[EliteWiki] Far Arm ships
[EliteWiki] Z-ships
[EliteWiki] Baakili Far Trader
[EliteWiki] Tin of SPAM
User avatar
Commander Learner
Dangerous
Dangerous
Posts: 123
Joined: Thu Aug 20, 2009 12:08 pm
Location: Somewheeeeeere over the rainbooooooooooow~

Post 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?
Shooting polygons since 2001
Post Reply