Dumb question on converting models with python
Moderators: winston, another_commander
Dumb question on converting models with python
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?
>>> 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
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.
Then just call them from a DOS prompt with the DAT filename as a parameter. Don't use a python console window for it.
Last edited by Thargoid on Thu May 02, 2013 6:29 am, edited 1 time in total.
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
Re: Dumb question on converting models with python
Thanks, I'll install v2.6.
Re: Dumb question on converting models with python
Obj2DatTexNorm.py
requires v2.7 (see Model converter utilities)- Diziet Sma
- ---- E L I T E ----
- Posts: 6312
- Joined: Mon Apr 06, 2009 12:20 pm
- Location: Aboard the Pitviper S.E. "Blackwidow"
Re: Dumb question on converting models with python
<wonders if perhaps it's time all the scripts were updated to work with 3.x>
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
- Tricky
- ---- E L I T E ----
- Posts: 821
- Joined: Sun May 13, 2012 11:12 pm
- Location: Bradford, UK. (Anarchic)
Re: Dumb question on converting models with python
.oO(wonders if the commandDiziet Sma wrote:<wonders if perhaps it's time all the scripts were updated to work with 3.x>
2to3
will do the job)Re: Dumb question on converting models with python
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?
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?
-
- Quite Grand Sub-Admiral
- Posts: 6683
- Joined: Wed Feb 28, 2007 7:54 am
Re: Dumb question on converting models with python
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: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?
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
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
Many thanks gents!