Page 2 of 2
Posted: Mon Jul 20, 2009 4:51 am
by Thargoid
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.
Posted: Mon Jul 20, 2009 7:06 am
by Diziet Sma
You could try uploading the pics to Photobucket instead, much less hassle..
http://photobucket.com/
Posted: Mon Jul 20, 2009 8:03 am
by Eric Walch
DaddyHoggy wrote:@parazaine - I just get little red dots instead of your images...
Am I colour blind? I only see blue squares, no dots.
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.
Posted: Mon Jul 20, 2009 8:28 am
by Griff
@ 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 obj2dat
tex.py script as the obj2dat.py script doesn't support textures
Posted: Mon Jul 20, 2009 8:33 am
by DaddyHoggy
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 obj2dat
tex.py script as the obj2dat.py script doesn't support textures
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...
"Photobucket is your friend..."
Posted: Mon Jul 20, 2009 1:00 pm
by parazaine
I have posted all pics on photobucket and redone links - hopefully shouldnt have any more problems - please let me know if anyone has any more problems viewing them - thanx
Posted: Mon Jul 20, 2009 1:06 pm
by parazaine
as i explained before, im a computer dunce - how do i open a dos cd (current dir?) to the dir the files are in?
Posted: Mon Jul 20, 2009 1:25 pm
by DaddyHoggy
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...
Posted: Mon Jul 20, 2009 2:15 pm
by parazaine
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?
Posted: Mon Jul 20, 2009 2:19 pm
by Thargoid
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).
Posted: Mon Jul 20, 2009 2:47 pm
by parazaine
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