Page 1 of 1

creating ships

Posted: Sun Mar 19, 2006 8:35 pm
by cactuar
I created a very basic ship as a learning tool, so to speak. The problem I am having is that the python script fails to convert the .obj into .dat. It says something about the .dat not existing, which is correct as the script is suppose to create it.

I am using SUSE and wings3D.

Posted: Sun Mar 19, 2006 8:52 pm
by Selezen
You have to type in the following command, with the .obj and .mtl files in the same folder as the script:

Code: Select all

obj2dattex.py filename.obj[/obj]

obviously replace the word filename with your obj file's name.

It sounds like you are entering the dat file name too. You don't have to.

Posted: Sun Mar 19, 2006 9:10 pm
by cactuar
ok, I tried what you said and I got:

Code: Select all

obj2dattex.py: command not found

I tried using upper case letters in the right places.

I am doing nothing with .dat files as none have been created!

Posted: Sun Mar 19, 2006 10:51 pm
by winston
Most UNIX systems do not have (by default) '.' (i.e. your current directory) in the path. (There are good security reasons for this - for instance, to stop root from accidentally running ./foo instead of /usr/bin/foo and having something uninteded happen).

When trying to execute a script or program in the current directory:

./obj2dattex.py

Note the './'. This means execute 'obj2dattex.py' in the current directory (rather than search the path for it).

Alternately, place 'obj2dattex.py' somewhere in the path, or add the location where it is to the path - but really, just typing ./ in front of the command is probably faster!

Posted: Mon Mar 20, 2006 10:14 am
by Selezen
:oops:

D'oh. Sorry - another Linux quirk to learn...

Posted: Mon Mar 20, 2006 11:56 am
by winston
Selezen wrote:
:oops:

D'oh. Sorry - another Linux quirk to learn...
Well, it's not Linux specific and it isn't a quirk either - Unix has worked that way ever since there was such thing as a shell, way back in 1969 :-)

Since Linux is a 'non-genetic Unix' (i.e. is to what Unix what Oolite is to Elite) it follows this convention. As does *BSD and Mac OS X.

Posted: Mon Mar 20, 2006 4:02 pm
by cactuar
OK, so could you tell me the exact 'phrase' i.e:

./obj2dattex.py filename.obj

is that right? Obviously is the correct directory I assume.

Posted: Mon Mar 20, 2006 4:11 pm
by winston
If that's the correct syntax to obj2dattex.py then yes - I don't know about that specific utility as I've not used it.

Posted: Mon Mar 20, 2006 4:11 pm
by milinks
Hi cactuar,
if you bring up a cmd screen and change your directory to wherever your model is, have a copy of the Obj2DatTex.py in THAT folder alongside your model, direct your comand screen i.e cd C:\OOLITE\Models or whatever it is then type Obj2DatTex.py "model name".obj - making sure you are case sensitive and it should work fine (hopefully)

Posted: Mon Mar 20, 2006 4:41 pm
by cactuar
Got it! Thanks guys. As that famous woman once said sometime "I always rely on the kindness of strangers" or something like that, anyway thanks again!

:D