The Seraphim - A custom Ship OXP from start to finish.
Moderators: winston, another_commander
I think that's what the script I had was originally called. On my machine it's actually renamed O2D.py (and D2O.py) as I got fed up with typing the longer version.
When I'm doing a conversion I copy the Obj2Dat.py into the same folder as the rest of the files (the obj file, the png texture file and the material mtl file if I remember correctly) using explorer.
Then open a command prompt, and go to the folder that way. CD \ to go to the root, then c: (or whatever drive you're files are on), cd <foldername>, cd <nextfoldernamedown> etc etc (or cd \<folder1>\<folder2>\<folder3> down the tree if you prefer).
Then when you get where you should be, do the script execution as previously mentioned. If you want and can zip them all up and put them somewhere suitable, I'd be happy to grab a copy and see if I can convert them on my machine here to test it's nothing wrong with the files or anything.
When I'm doing a conversion I copy the Obj2Dat.py into the same folder as the rest of the files (the obj file, the png texture file and the material mtl file if I remember correctly) using explorer.
Then open a command prompt, and go to the folder that way. CD \ to go to the root, then c: (or whatever drive you're files are on), cd <foldername>, cd <nextfoldernamedown> etc etc (or cd \<folder1>\<folder2>\<folder3> down the tree if you prefer).
Then when you get where you should be, do the script execution as previously mentioned. If you want and can zip them all up and put them somewhere suitable, I'd be happy to grab a copy and see if I can convert them on my machine here to test it's nothing wrong with the files or anything.
Last edited by Thargoid on Fri Jan 09, 2009 10:17 pm, edited 1 time in total.
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
Nah, my copy is definately called obj2dat.py and Dat2Obj.py - the upper and lower cases are correct too.
I have a suspicion that I'm just not in the right path, or entering the line correctly. It keeps pointing to seemingly random characters in the line with a ^ and stating that it's incorrect syntax.
In the Windows DOS command line if I type CD\ it takes me to the root of the C drive. Is this the same for Python? When I do that, there's no indication which drive or subdirectory I'm in. I just get ...
Crow
I have a suspicion that I'm just not in the right path, or entering the line correctly. It keeps pointing to seemingly random characters in the line with a ^ and stating that it's incorrect syntax.
In the Windows DOS command line if I type CD\ it takes me to the root of the C drive. Is this the same for Python? When I do that, there's no indication which drive or subdirectory I'm in. I just get ...
Crow
The other question is what version of python do you have installed, and do you have it associated with the .py file extension?
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
Okay, I type CD\ and I get ...
Then I type C: and I get:
I tired Cd\c and CD\C:
And got the same thing with:
Crow
Then I type C: and I get:
Code: Select all
File "<stdin>", line 2
c:
^
Syntax Error: Invalid Syntax.
And got the same thing with:
Code: Select all
Syntax Error: Unexpected character after line continuation character
To change drives, it's just c: or d: or whatever, no cd.
You only use cd to change directory (that being what it stands for).
I just checked the scripts on my webspace and they're ascii (was just wondering if I'd managed to upload them as binary or something) as they should be.
Can you post a list of the files in the folder you're trying to convert? So we can see if everything's there that should be?
Or as I said upload a zip file somewhere and I'll try it here and check them for you.
You only use cd to change directory (that being what it stands for).
I just checked the scripts on my webspace and they're ascii (was just wondering if I'd managed to upload them as binary or something) as they should be.
Can you post a list of the files in the folder you're trying to convert? So we can see if everything's there that should be?
Or as I said upload a zip file somewhere and I'll try it here and check them for you.
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
- Griff
- Oolite 2 Art Director
- Posts: 2483
- Joined: Fri Jul 14, 2006 12:29 pm
- Location: Probably hugging his Air Fryer
Hi Scarecrow! Great to see someone else from Wales here!
You can download the latest versions of the scripts from here:
http://svn.berlios.de/svnroot/repos/ool ... onverters/
even though the above path says oolite-linux these scripts definately work on my windows pc, and probably on apple macs as well
I use the Obj2DatTex.py script to convert an .obj file to the .dat format Oolite likes, and i use the Dat2ObjTex.py script to convert a .dat back to a .obj (the Dat2ObjTex.py keeps any UV map data in the model during the conversion process, the Dat2Obj.py script doesn't seem to do this)
regarding the syntax error there might be confusion here between the python command prompt and the windows command prompt, you need to use the windows command prompt to run the python scripts rather weirdly!
try this
click the start button, then select Run.. from the menu
in the box labeled "open:" type cmd then press enter
you should get a command prompt window open up with something like
c:\Documents and Settings\your_username by a flashing cursor,
type cd \ and press enter
this should get you to the root of your c drive, next type
cd Oolitegubbins and press enter
the text by the flashing cursor should now read C:\Oolitegubbins
if it does type obj2dat.py flobit.obj and press enter
now, back in windows, navigate to the Oolitegubbins folder and you should find a newly created flobit.dat file, you can then close the command prompt window and pop the flobit.dat file in your oxp's Models subfolder
You can download the latest versions of the scripts from here:
http://svn.berlios.de/svnroot/repos/ool ... onverters/
even though the above path says oolite-linux these scripts definately work on my windows pc, and probably on apple macs as well
I use the Obj2DatTex.py script to convert an .obj file to the .dat format Oolite likes, and i use the Dat2ObjTex.py script to convert a .dat back to a .obj (the Dat2ObjTex.py keeps any UV map data in the model during the conversion process, the Dat2Obj.py script doesn't seem to do this)
regarding the syntax error there might be confusion here between the python command prompt and the windows command prompt, you need to use the windows command prompt to run the python scripts rather weirdly!
try this
click the start button, then select Run.. from the menu
in the box labeled "open:" type cmd then press enter
you should get a command prompt window open up with something like
c:\Documents and Settings\your_username by a flashing cursor,
type cd \ and press enter
this should get you to the root of your c drive, next type
cd Oolitegubbins and press enter
the text by the flashing cursor should now read C:\Oolitegubbins
if it does type obj2dat.py flobit.obj and press enter
now, back in windows, navigate to the Oolitegubbins folder and you should find a newly created flobit.dat file, you can then close the command prompt window and pop the flobit.dat file in your oxp's Models subfolder
Exactly what the man sez
I think the key point here is the scripts run out of a windows command prompt, not the python command line. I just had a look at that (I must admit I hadn't noticed it actually existed ), and I get the same kind of errors you talked about earlier. So I think that's the root of your problems here.
Sorry, I should have been more clear before perhaps
The scripts Griff mentions are the ones you have (if you got them from my webspace, and they've not been updated on Berlios for the last few months), or at least that's where I downloaded from. I just renamed them as I got fed up with typing all that filename into the command prompt every time (they're called O2D.py and D2O.py on my machine, cos I'm a lazy alien).
I think the key point here is the scripts run out of a windows command prompt, not the python command line. I just had a look at that (I must admit I hadn't noticed it actually existed ), and I get the same kind of errors you talked about earlier. So I think that's the root of your problems here.
Sorry, I should have been more clear before perhaps
The scripts Griff mentions are the ones you have (if you got them from my webspace, and they've not been updated on Berlios for the last few months), or at least that's where I downloaded from. I just renamed them as I got fed up with typing all that filename into the command prompt every time (they're called O2D.py and D2O.py on my machine, cos I'm a lazy alien).
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
HA windows command line! I didn't even think to try it. I assumed that a Python script would need to be run through the Python command line
I think I did try the windows command line yesterday but I think it was before I installed Python so naturally it didn't have a clue what I was talking about.
Okay.....
I tried the Windows command line and I got this:
NOTE: I've put the script and the obj file into the root of C to make things simpler. I've also renamed the script to o2d.py because I, too am lazy
So the path and file names are correct. The interesting thing is that when I opened the script in the Python editor and tried to run it from there, it also highlighted that same line as an error. It didn't like the quotation marks!
Crow
PS - Griff, whereabouts are you? I was a Barry boy originally - now living in Coventry.
I think I did try the windows command line yesterday but I think it was before I installed Python so naturally it didn't have a clue what I was talking about.
Okay.....
I tried the Windows command line and I got this:
Code: Select all
C:\>o2d.py flobit.obj
File "C:\o2d.py", line 24
print "converting..."
^
SyntaxError: invalid syntax
So the path and file names are correct. The interesting thing is that when I opened the script in the Python editor and tried to run it from there, it also highlighted that same line as an error. It didn't like the quotation marks!
Crow
PS - Griff, whereabouts are you? I was a Barry boy originally - now living in Coventry.
Hmm, it sounds like there's something not right in your obj file. When I export mine from Wings3D I get a materials file too (.mtl), but I just tried a conversion of the obj without the mtl and whilst I get an error then it's not the same as the one you get.
Are there any settings or configurations you can do within Maya in relation to obj output? As I said I use Wings so I can't be much help there.
You're doing everything I do in exactly the same way I do it and mine works. The only difference of course is your obj file itself (and your Python install, mine's 2.5 rather than 3 but I doubt that's a factor).
Are there any settings or configurations you can do within Maya in relation to obj output? As I said I use Wings so I can't be much help there.
You're doing everything I do in exactly the same way I do it and mine works. The only difference of course is your obj file itself (and your Python install, mine's 2.5 rather than 3 but I doubt that's a factor).
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
Actually, it is. Python 2.x and Python 3 are incompatible. It should be possible to install them side by side, and there’s a tool to convert Python 2 scripts to Python 3.Thargoid wrote:You're doing everything I do in exactly the same way I do it and mine works. The only difference of course is your obj file itself (and your Python install, mine's 2.5 rather than 3 but I doubt that's a factor).
E-mail: [email protected]
Well that's my learning point for today
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link