Details of converting ship.obj to ship.dat using python 2.6
Moderators: winston, another_commander
Normally with python installed, simplest way is to put everything you need (model .obj and .mtl files, texture .png file nad script .py file) into one directory.
Then open said DOS prompt (NOT a Python prompt), cd to that directory and then type:
obj2dat.py <filename>.obj
where <filename> is replaced by the name of you file. It should then go off and do it's thang and leave you with a .dat file of the same filename.
This does presume that you've not changed any filenames or anything like that, for example renaming the texture file since you created the .obj file. If you have done that then the .obj file will need to be editted first to reflect that (it's just a text file).
PS I can't see any images at all in any post in this thread so far, just placeholder icons. I can only see your images by quoting your posts and extracting the links by c&p.
Then open said DOS prompt (NOT a Python prompt), cd to that directory and then type:
obj2dat.py <filename>.obj
where <filename> is replaced by the name of you file. It should then go off and do it's thang and leave you with a .dat file of the same filename.
This does presume that you've not changed any filenames or anything like that, for example renaming the texture file since you created the .obj file. If you have done that then the .obj file will need to be editted first to reflect that (it's just a text file).
PS I can't see any images at all in any post in this thread so far, just placeholder icons. I can only see your images by quoting your posts and extracting the links by c&p.
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
- Diziet Sma
- ---- E L I T E ----
- Posts: 6311
- Joined: Mon Apr 06, 2009 12:20 pm
- Location: Aboard the Pitviper S.E. "Blackwidow"
You could try uploading the pics to Photobucket instead, much less hassle..
http://photobucket.com/
http://photobucket.com/
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
Am I colour blind? I only see blue squares, no dots.DaddyHoggy wrote:@parazaine - I just get little red dots instead of your images...
And just curious: Does there not exist a "drop" shell script for windows like for Mac? There we have a file when the file is dropped on, it executes the script on that file. You can even replace the internal scripts by your own. I did this because not for all actions there was a mac drop program. (I know, I am to lazy to type in those commands every time) For non programmers this is an easy method and I can't imagine something like that does not exist for windows.
UPS-Courier & DeepSpacePirates & others at the box and some older versions
- Griff
- Oolite 2 Art Director
- Posts: 2481
- Joined: Fri Jul 14, 2006 12:29 pm
- Location: Probably hugging his Air Fryer
@ the first page of this thread, I can't see the pictures either, even the one DH can see.
there's lots of tips on converting ship models using the scripts in here
https://bb.oolite.space/viewtopic.php?t=4676
IIRC, make sure you use the obj2dattex.py script as the obj2dat.py script doesn't support textures
there's lots of tips on converting ship models using the scripts in here
https://bb.oolite.space/viewtopic.php?t=4676
IIRC, make sure you use the obj2dattex.py script as the obj2dat.py script doesn't support textures
- DaddyHoggy
- Intergalactic Spam Assassin
- Posts: 8515
- Joined: Tue Dec 05, 2006 9:43 pm
- Location: Newbury, UK
- Contact:
I can't see even my relinked image any more either (now at work) - perhaps they were just cached on my local machine when I did the relink...Griff wrote:@ the first page of this thread, I can't see the pictures either, even the one DH can see.
there's lots of tips on converting ship models using the scripts in here
https://bb.oolite.space/viewtopic.php?t=4676
IIRC, make sure you use the obj2dattex.py script as the obj2dat.py script doesn't support textures
"Photobucket is your friend..."
Oolite Life is now revealed hereSelezen wrote:Apparently I was having a DaddyHoggy moment.
- DaddyHoggy
- Intergalactic Spam Assassin
- Posts: 8515
- Joined: Tue Dec 05, 2006 9:43 pm
- Location: Newbury, UK
- Contact:
To minimise typing and for your first attempt I would suggest in normal "Windows" create a new folder on the C: drive at the top level - i.e. directly under the "C:" and call it something sensible like "oolite_test_ship" (without the quotes!)
Copy all the files you need into this directory
in the cmd window type:
this will move your current directory (wherever you are) to c:\oolite_test_ship (cd basically shorthand for Change Directory)
To confirm in the cmd window type
and you should see that you are indeed in the correct directory and all the necessary files are present and correct.
Then do what Thargoid said in his earlier posting...
Copy all the files you need into this directory
in the cmd window type:
Code: Select all
cd c:\oolite_test_ship
To confirm in the cmd window type
Code: Select all
dir
Then do what Thargoid said in his earlier posting...
Oolite Life is now revealed hereSelezen wrote:Apparently I was having a DaddyHoggy moment.
made some progress lol - managed to run obj2dattex.py (obj2dat.py didnt work?) but got the following error message
converting...
['copperhead.obj']
copperhead.obj->copperhead.dat
traceback <most recent call last>
File "obj2dattex.py", line 31, in <module>
input file = open < input filename, "r" >
IOError : no such file or directory : 'copperhead.obj'
you also mentioned a NAD script file? dont have one of those, what is it?
converting...
['copperhead.obj']
copperhead.obj->copperhead.dat
traceback <most recent call last>
File "obj2dattex.py", line 31, in <module>
input file = open < input filename, "r" >
IOError : no such file or directory : 'copperhead.obj'
you also mentioned a NAD script file? dont have one of those, what is it?
'Either this wallpaper goes, or I do'
Oscar Wilde's last words
Oscar Wilde's last words
It should be obj2dat.py that you're using - when you say it "didn't work", what exactly do you mean?
Your dump-out above indicates that it can't find copperhead.obj, have you actually exported your ship out of Wings3D as a .obj file? That is the file you need to be working on (not a .wings3d file or anything else), you can do it through the file>export menu entry. That will output the obj file, you should save it to the work folder where you've put the obj2dat.py file (the one you go to in the DOS prompt, "c:\oolite_test_ship" or whatever you've called it).
Your dump-out above indicates that it can't find copperhead.obj, have you actually exported your ship out of Wings3D as a .obj file? That is the file you need to be working on (not a .wings3d file or anything else), you can do it through the file>export menu entry. That will output the obj file, you should save it to the work folder where you've put the obj2dat.py file (the one you go to in the DOS prompt, "c:\oolite_test_ship" or whatever you've called it).
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
Thanks for your patience, i finally managed to generate the .dat file (had to delete PNG and OBJ files and re-export them to get it to work (i might have renamed texture file, like you suggested) anyway, thanks to everyone for your help - i now have to figure out the last stage lol, may take me a while
'Either this wallpaper goes, or I do'
Oscar Wilde's last words
Oscar Wilde's last words