Help! I'm new at this!

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

RebelRunner
Poor
Poor
Posts: 6
Joined: Mon Jun 23, 2014 7:44 pm

Help! I'm new at this!

Post by RebelRunner »

So, I'm looking to import some preexisting assets into an OXP. What I have is this:
-.obj files
-.dds textures
Along with Blender, Wings3d, and a couple random conversion tools I used to get to this point. I'm basically trying to figure out how to merge the textures with my .obj files, and convert the whole shabang into .dat files that can then be compiled into part of an OXP. I have done some poking around, and have not yet figured out how to get any of the Python conversion utilities to work.

Any suggestions?
User avatar
Norby
---- E L I T E ----
---- E L I T E ----
Posts: 2577
Joined: Mon May 20, 2013 9:53 pm
Location: Budapest, Hungary (Mainly Agricultural Democracy, TL10)
Contact:

Re: Help! I'm new at this!

Post by Norby »

Hi RebelRunner, welcome on this board (which seems to be the firendliest this side of Riedquat ;)) !

If you are lucky then simply convert all .dds to .png (for example with the free irfanview), run Obj2DatTex.py and replace all .dds extension to .png in the .dat file.

Check the [wiki]OXP_howto[/wiki] and [wiki]OXP_howto_model[/wiki] pages in the wiki, look into other ship OXPs and feel free to ask as many times as you want until you will be done, there are very helpful folks here.
RebelRunner
Poor
Poor
Posts: 6
Joined: Mon Jun 23, 2014 7:44 pm

Re: Help! I'm new at this!

Post by RebelRunner »

How and where would I run the Python script? I had originally tried to set it up as a Blender plugin, but this was either incorrect or I did it wrong.

Thanks for the quick and friendly response :D :D
User avatar
maik
Wiki Wizard
Wiki Wizard
Posts: 2028
Joined: Wed Mar 10, 2010 12:30 pm
Location: Ljubljana, Slovenia (mainly industrial, feudal, TL12)

Re: Help! I'm new at this!

Post by maik »

Hi RebelRunner, and welcome.

You need to run the Python script from your command line. If you're on Linux or Mac OS X, then your system should already come with a Python interpreter, on Windows you would need to install one first.
User avatar
Diziet Sma
---- E L I T E ----
---- E L I T E ----
Posts: 6312
Joined: Mon Apr 06, 2009 12:20 pm
Location: Aboard the Pitviper S.E. "Blackwidow"

Re: Help! I'm new at this!

Post by Diziet Sma »

G'day, RebelRunner, and welcome aboard! 8)
maik wrote:
You need to run the Python script from your command line. If you're on Linux or Mac OS X, then your system should already come with a Python interpreter, on Windows you would need to install one first.
Note also that the script requires Python 2.6 or greater, but will not work with Python 3.x. This is possibly the problem when you tried using the script as a Blender plugin, since Blender uses Python 3.3. It is possible to force a script to use Python 2 on a computer which has both 2 & 3 installed. Simply change the first line of each script from:

Code: Select all

#!/usr/bin/python
To:

Code: Select all

#!/usr/bin/python2
(To be honest, all the mesh-conversion scripts should be updated to include this small detail.. or better yet, be re-written to run on Python 3.x)

(I've also just updated the download link on the mesh-converters Wiki-page to point to GitHub, instead of BerliOS)
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
RebelRunner
Poor
Poor
Posts: 6
Joined: Mon Jun 23, 2014 7:44 pm

Re: Help! I'm new at this!

Post by RebelRunner »

Thanks. I've got the conversion scripts you mentioned. I also figured out how to open up the Python interpreter, but am unable to figure out just how to run the scripts. If the script is located at C:\...\Obj2DatTex.py, what would the command be to run it? Additionally, when/where would I point the script to the .obj I'm trying to convert?
User avatar
Diziet Sma
---- E L I T E ----
---- E L I T E ----
Posts: 6312
Joined: Mon Apr 06, 2009 12:20 pm
Location: Aboard the Pitviper S.E. "Blackwidow"

Re: Help! I'm new at this!

Post by Diziet Sma »

Well, to quickly steal borrow the answer from another thread:
Mauiby de Fug wrote:
Okay, it's been a while since I last did this, and I haven't got it set up on my computer yet, but I believe that you first of all need to have the Obj2DatTex.py file in the same folder as the file you want to convert. Then, open a normal terminal, and cd into the folder. Then, try running something like python Obj2DatTex.py ModelToConvert.obj and see if that does something...
On Windows, you'd say "Command prompt" instead of "terminal", but otherwise, the procedure is identical.

(oh yeah.. and you don't need to go near the Python interpreter at all.. all the scripts are run from a Command prompt in the same manner as the above)
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
User avatar
Griff
Oolite 2 Art Director
Oolite 2 Art Director
Posts: 2483
Joined: Fri Jul 14, 2006 12:29 pm
Location: Probably hugging his Air Fryer

Re: Help! I'm new at this!

Post by Griff »

This is specific to windows but make sure you run the script from the windows command prompt and not the 'Python (command line)' shortcut that gets installed alongside python
edit: sorry, should have read Dizzy's post above he's already got this covered :oops:

If you're on WIndows 7 you can quickly open a command prompt at the folder where you've put your ship .obj files and the Obj2DatTex.py script by holding down the shift key then right clicking on your folder in explorer, there'll be a new option "open command window here" on the pop-up menu
RebelRunner
Poor
Poor
Posts: 6
Joined: Mon Jun 23, 2014 7:44 pm

Re: Help! I'm new at this!

Post by RebelRunner »

Okay, this is promising...now what is this 'cd' the thread Dizzy directed me to? A way to point Python to the proper folder? How would I use it?
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16081
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: Help! I'm new at this!

Post by Cody »

Hmm... if my memory serves, cd as a typed command means 'call directory'.
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
User avatar
Norby
---- E L I T E ----
---- E L I T E ----
Posts: 2577
Joined: Mon May 20, 2013 9:53 pm
Location: Budapest, Hungary (Mainly Agricultural Democracy, TL10)
Contact:

Re: Help! I'm new at this!

Post by Norby »

http://www.google.com/#q=change+directory

If you do not want to type your commands again and again then open a text file, type into and save as something.bat (if I guess right and you use windows) then double click on this file. https://www.google.hu/#q=Batch+file - the wikihow page contain nice screenshots.
RebelRunner
Poor
Poor
Posts: 6
Joined: Mon Jun 23, 2014 7:44 pm

Re: Help! I'm new at this!

Post by RebelRunner »

Okay, so I changed the working directory as appropriate, entered python Obj2DatTex.py modelname.obj, and got the error message IOError: [Errno 2] No such file or directory: 'modelname.obj'.

The file and script are in the same directory/folder as they should be. I'm really starting to get confused here.
User avatar
Norby
---- E L I T E ----
---- E L I T E ----
Posts: 2577
Joined: Mon May 20, 2013 9:53 pm
Location: Budapest, Hungary (Mainly Agricultural Democracy, TL10)
Contact:

Re: Help! I'm new at this!

Post by Norby »

Try to give the whole path of .obj file like "c:\windows\modelname.obj" , and use the quotation marks if there is a space in the name.
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Re: Help! I'm new at this!

Post by Thargoid »

And without wishing to state the obvious, modelname.obj should of course be replaced by the actual filename of your model's obj file. Also when you installed python it should have put itself onto your command line path (again presuming you're in Windows) and associated itself with .py files.

When I do this kind of thing, I usually just copy the script file into the same folder as the obj/mtl/png files and type obj2dattex.py myWhizzyShip.obj in a normal DOS command line prompt, where myWhizzyShip.obj is the name of the relevant obj file. I guess explicitly adding python to the start won't hurt, but if you have proper association set up (type path at a DOS prompt and it should show your search path, if that includes the location that the python executable is in then your machine will see it wherever you type obj2dattex.py).
User avatar
spud42
---- E L I T E ----
---- E L I T E ----
Posts: 1576
Joined: Wed Mar 26, 2014 10:11 am
Location: Brisbane,Australia

Re: Help! I'm new at this!

Post by spud42 »

you can right click on the py script and then select "open with" if python isnt in the list then use the browse button...
Arthur: OK. Leave this to me. I'm British. I know how to queue.
OR i could go with
Arthur Dent: I always said there was something fundamentally wrong with the universe.
or simply
42
Post Reply