Page 1 of 1

Dumb question on converting models with python

Posted: Wed May 01, 2013 11:58 am
by hangar18
I'm new to Python and wanted to converted a dat file back to obj so I can manipulate in wings. However, I cant even get python to work lol. Have downloaded v3.3 for Windows and at the command prompt typed (as per the model converter sticky)

>>> python c:\python33\progs\Obj2DatTex.py c:\python33\models\Cobra3.dat

But get a syntax error. Both Obj2DatTex.py and Cobra3.dat are saved in the directories outlined. What am I doing wrong?

Re: Dumb question on converting models with python

Posted: Wed May 01, 2013 12:03 pm
by Thargoid
You need python v2.5 or 2.6. The scripts don't work with 3.x.

Then just call them from a DOS prompt with the DAT filename as a parameter. Don't use a python console window for it.

Re: Dumb question on converting models with python

Posted: Thu May 02, 2013 12:27 am
by hangar18
Thanks, I'll install v2.6.

Re: Dumb question on converting models with python

Posted: Thu May 02, 2013 9:12 am
by Svengali
Obj2DatTexNorm.py requires v2.7 (see Model converter utilities)

Re: Dumb question on converting models with python

Posted: Thu May 02, 2013 9:56 am
by Diziet Sma
<wonders if perhaps it's time all the scripts were updated to work with 3.x>

Re: Dumb question on converting models with python

Posted: Thu May 02, 2013 2:56 pm
by Tricky
Diziet Sma wrote:
<wonders if perhaps it's time all the scripts were updated to work with 3.x>
.oO(wonders if the command 2to3 will do the job)

Re: Dumb question on converting models with python

Posted: Mon May 06, 2013 9:14 am
by hangar18
Sorry guys am stuck...

I tried typing in a dos command box

python c:\python27\progs\Obj2DatTex.py c:\python27\models\Cobra3.dat

But get a syntax error of 'python is not recognizable command'. So I then tried....

c:\python\python.exe

and got a >>> prompt. Progress I thought...but

c:\python27\progs\Obj2DatTex.py c:\python27\models\Cobra3.dat

an invalid syntax response at the "c:" bit I tried putting python before the c:\ with a space but no joy

What am I doing wrong?

Re: Dumb question on converting models with python

Posted: Mon May 06, 2013 9:22 am
by another_commander
hangar18 wrote:
Sorry guys am stuck...

I tried typing in a dos command box

python c:\python27\progs\Obj2DatTex.py c:\python27\models\Cobra3.dat

But get a syntax error of 'python is not recognizable command'. So I then tried....

c:\python\python.exe

and got a >>> prompt. Progress I thought...but

c:\python27\progs\Obj2DatTex.py c:\python27\models\Cobra3.dat

an invalid syntax response at the "c:" bit I tried putting python before the c:\ with a space but no joy

What am I doing wrong?
The folder containing python.exe must be in your command search path. For example, if your python installation is at C:\python and the python executable is C:\python\python.exe, then you can do it by:
1. Starting up a command console window and
2. Typing in path=%path%;c:\python
Then just use the commands as you originally tried and this time you should be able to execute python.exe.

Re: Dumb question on converting models with python

Posted: Mon May 06, 2013 9:24 am
by Svengali
Obj2DatTex.py expects a .obj + .mtl.
To convert back you need Dat2ObjTex.py. This should work via drag&drop (if your Python installer has set the Pathes correctly - see another_commanders post)

Re: Dumb question on converting models with python

Posted: Tue May 07, 2013 8:34 am
by hangar18
Many thanks gents!