Model converter utilities

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

Moderators: another_commander, winston

User avatar
tsoj
Deadly
Deadly
Posts: 199
Joined: Wed May 18, 2016 8:19 pm
Location: Berlin
Contact:

Re: Model converter utilities

Post by tsoj »

Old Murgh wrote: Mon Dec 13, 2021 11:03 pm
My errors are all related to Terminal not being able to find the .py file, but there are so many possibilities as to what might be the problem. The location of the scripts, adjacent to the file I'm trying to convert shouldn't be the problem. I suspect more, since I couldn't download the scripts but rather had to copy/paste them to text files, is that the scripts themselves are illegitimate.
If I remember correctly, I too had a few issues with the object converters, though I am not sure exactly what it was. Could you paste the error message here? This makes it easier for us to help. Unfortunately, there isn't any YouTube video as far as I know.
User avatar
Old Murgh
Wiki Wizard
Wiki Wizard
Posts: 639
Joined: Sat Dec 04, 2021 11:01 pm

Re: Model converter utilities

Post by Old Murgh »

tsoj wrote: Mon Dec 13, 2021 11:26 pm
If I remember correctly, I too had a few issues with the object converters, though I am not sure exactly what it was. Could you paste the error message here?
It's maddening. Most likely I have the scripts intact since ONCE in ca. 40 attempts IT WORKED. Sortof.
Python Dat2ObjTex.py hship.dat
produced the files hship.obj and hship.mtl as advertised, –but, this failed to open in my brand new Wings3D as "Read failed: Not a Wings file (or old Wings format)". But nevermind, this is a problem for later..

I have since been unable to reproduce my tiny success. All attempts to use Dat2ObjTex.py or Dat2Obj.py results in Terminal complaining, Python: can't open file 'Dat2ObjTex.py': [Errno 2] No such file or directory

I can't think of a single thing that changed between the time it worked and all the times it didnt. Very frustrating.
Please recognise a common novice error with an easy fix.

[ed]
I can gather most likely my fail is placing these files in the proper directory but where is that supposed to be? the "search string' at the start of my Terminal response
/library/Frameworks/Python/.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python looks circular to me and gives me no good clue as to where I should put the scripts and files for recognition. It seems crazy to me that this script should be utterly location sensitive.

And how depressing that I am the only person to suffer with this.
I was young, I was naïve. [EliteWiki] Jonny Cuba made me do it!
User avatar
cbr
---- E L I T E ----
---- E L I T E ----
Posts: 1390
Joined: Thu Aug 27, 2015 4:24 pm

Re: Model converter utilities

Post by cbr »

Rename the daTob2-etc.py to a simpler name eg cbr.py perhaps the name has errors?

the python file has no hidden 'extension' daTob2-etc.py.txt ?

Make a hello_world.py file to check if python is working et al?

Copy and editing python content in a text editor sometimes messes up the indentations?
User avatar
tsoj
Deadly
Deadly
Posts: 199
Joined: Wed May 18, 2016 8:19 pm
Location: Berlin
Contact:

Re: Model converter utilities

Post by tsoj »

Old Murgh wrote: Tue Dec 14, 2021 10:23 pm
It's maddening.
Mmh, I don't see immediately what's causing the problem. The idea I have is that I am going to write a step-by-step recipe how to do what you want to do, so that we can find at what point the first thing goes wrong. It could be that I am explaining stuff that's already obvious to you, but I guess, better give more information than too little. So:

(From your previous comment, I am assuming that you are using a Mac? It shouldn't matter much, but would probably good to know anyway.)
- Go to github.com/OoliteProject/oolite-mesh-converters and click on the green button with the label "Code".
- There will be a small pop-up window. There you click on "Download ZIP". This should download a zip file called "oolite-mesh-converters-master.zip". Save it wherever you can find it (to the desktop maybe) for now, you can remove it later when we are finished.
- Unzip/extract the zip-file (depending on which OS you are using, this may be done by right-clicking on the folder and selected the "unpack here" or "extract here" option).
- Now you have a folder called "oolite-mesh-converters-master". Open a terminal and go into this folder. If you're on MacOS, you can check if you're really there by entering "pwd" into the terminal and then press enter. This should print a file path that ends with "/oolite-mesh-converters-master".
- Check if your python installation works: enter "python2 --version" into the terminal. This should print something like "Python 2.7.x", where "x" can be any number.
- Now copy your dat-file into the same directory (i.e. into ".../oolite-mesh-converters-master"). I am assuming that it is called "hship.dat".
- Now enter "python2 ./Dat2ObjTex.py ./hship.dat". This should produce the mentioned "hship.obj" and "hship.mtl" files.

Let's first get here. If at any part something different happens that what I described, let me know. Maybe I messed up, or we found the problem.

I don't really know what to do about the Wings3D part, as I never used it. Just in case you have a lot of free time, you could try to use Blender.
Commander_X
---- E L I T E ----
---- E L I T E ----
Posts: 664
Joined: Sat Aug 09, 2014 4:16 pm

Re: Model converter utilities

Post by Commander_X »

Old Murgh wrote: Tue Dec 14, 2021 10:23 pm
[...] Python Dat2ObjTex.py hship.dat [....] this failed to open in my brand new Wings3D as "Read failed: Not a Wings file (or old Wings format)"[...]
tsoj wrote: Wed Dec 15, 2021 12:51 am
[...] - Now enter "python2 ./Dat2ObjTex.py ./hship.dat". [...]
Will try to alleviate some of the pains of Old Murgh here.

If you take a look at your "python" command that gave you the error, and what tsoj suggested, these are the things you should be aware of:

- unless you're running on Windows, "Python" != "python" (that is, your filesystem, and thus, the way your system finds files, _is_ case sensitive; you shouldn't arbitrarily write "Python" and expect an executable file named "python" to be found -- the capital "P" at the beginning _will not match_)

- notice "./" in front of the files to process -- it is always a good practice to "address" the files in the filesystem.
This way, if by any chance 1. you have, e.g., the same "hship.dat" file in both your current folder (named . in most cases), and in your OXP folder (let's pretend in "../../AddOns/TheGreatestShipOfAll.oxp/Models"), but 2. for some reason your "program" will find the latter _before_ the first by default, then calling "./hship.dat" on your command line will avoid this type of confusion.

About processing the resulting ".obj" file with Wings3D, _you should not_ "File/Open..." it, but "File/Import/Wavefront (.obj)..." (I'm not sure there is a way for Wings3D on any platform to interpret click&drag other than "File/Open...", so you'll have to manually 1. do the menu trip 2. navigate in the file dialog to the folder where your ".obj" file was generated, and select it there)
User avatar
Old Murgh
Wiki Wizard
Wiki Wizard
Posts: 639
Joined: Sat Dec 04, 2021 11:01 pm

Re: Model converter utilities

Post by Old Murgh »

Thanks all of you for helping. This step by step is just what I need.
I should have been totally clear, yes, I'm on a Mac (10.14.6)

Python responds to version query, "Python 2.7.11"
I do the zip d/l from github, it arrives already unzipped, my "oolite-mesh.converters-master" should be fine. I put it in a tools folder inside my games folder. (I avoid just the desktop since this automatically copies and moves stuff to an iCloud desktop). This location should then be Users/murgh/Games/Tools/oolite-mesh-converters-master
tsoj wrote: Wed Dec 15, 2021 12:51 am
- Now you have a folder called "oolite-mesh-converters-master". Open a terminal and go into this folder. If you're on MacOS, you can check if you're really there by entering "pwd" into the terminal and then press enter. This should print a file path that ends with "/oolite-mesh-converters-master".
Now see, no matter how much window or folder selection trickery I do, pwd always only gets me
/Users/murgh

[suspenseful music]
So there it is! I place desired script at the top level in my user folder with the .dat and I immediately get
converting...
['hship.dat']
hship.dat->hship.obj & hship.mtl
done
tsoj wrote: Wed Dec 15, 2021 12:51 am
... or we found the problem.
[triumphant theme]
Yes! The one place my terminal will work with me is at top level in my userfolder. It refuses to go deeper since I don't know how to select another address..
Commander_X wrote: Wed Dec 15, 2021 4:25 pm
About processing the resulting ".obj" file with Wings3D, _you should not_ "File/Open..." it, but "File/Import/Wavefront (.obj)..."
Importing the .obj does result in the desired loading of old model. Another success. Thank you.
tsoj wrote: Wed Dec 15, 2021 12:51 am
I don't really know what to do about the Wings3D part, as I never used it. Just in case you have a lot of free time, you could try to use Blender.
Well now I see my models again in Wings for the first time in many years. Then I used a mouse, and now I have a MacBookPro trackpad which seems a crazy new thing in Wings, seems much more difficult to control. Are there many upsides to working with Blender?

I should probably give myself a mouse for xmas. And a joystick.
I was young, I was naïve. [EliteWiki] Jonny Cuba made me do it!
User avatar
tsoj
Deadly
Deadly
Posts: 199
Joined: Wed May 18, 2016 8:19 pm
Location: Berlin
Contact:

Re: Model converter utilities

Post by tsoj »

Nice that it worked out well :D
Old Murgh wrote: Wed Dec 15, 2021 7:22 pm
Now see, no matter how much window or folder selection trickery I do, pwd always only gets me
/Users/murgh
In the terminal, you can use the command "cd" to change directory.
So if you want to change into the directory "/Users/murgh/Games/Tools/oolite-mesh-converters-master", then you need to enter "cd /Users/murgh/Games/Tools/oolite-mesh-converters-master" and this should put you into the desired place (i.e. now pwd should print out the entered path). The "/" at the beginning is important. It means that the path you sent starts at the filesystem root.

For example, if you're in the folder "/Users/murgh", you can type "cd Documents/" (WITHOUT "/" at the beginning) into the terminal, and it looks if it finds the folder "Documents" where you currently are, and then goes into there.

Might be a bit confusing (especially how I wrote it ...). In case you want to use the terminal more, I can suggest a YouTube video like this. Especially in cases like this, learning with visuals is much easier (at least I find that for me).
User avatar
Cholmondely
Archivist
Archivist
Posts: 4997
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: Model converter utilities

Post by Cholmondely »

Old Murgh wrote: Wed Dec 15, 2021 7:22 pm
Thanks all of you for helping. This step by step is just what I need.
I should have been totally clear, yes, I'm on a Mac (10.14.6)
Well now I see my models again in Wings for the first time in many years. Then I used a mouse, and now I have a MacBookPro trackpad which seems a crazy new thing in Wings, seems much more difficult to control. Are there many upsides to working with Blender?

I should probably give myself a mouse for xmas. And a joystick.
Thrustmaster HOTAS 4 works on Mac. (See our wiki for details as to how, which are not obvious and take lots of searching to discover). It feels very good to me (the shape, etc). Not very many buttons and things, but it does feel good.
I supplement it with Elgato's Streamdeck, but Arquebus prefers Touch Portal and has set up a profile for it.

On Blender: https://bb.oolite.space/viewtopic.ph ... 74#p258574 Gsagostinho (2017): I think I am addicted to Wings3D, learned how to use it in just a few days after banging my head against Blender's wall for years.

- just look at his models in the linked thread!
Comments wanted:
Missing OXPs? What do you think is missing?
Lore: The economics of ship building How many built for Aronar?
Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
Commander_X
---- E L I T E ----
---- E L I T E ----
Posts: 664
Joined: Sat Aug 09, 2014 4:16 pm

Re: Model converter utilities

Post by Commander_X »

Old Murgh wrote: Wed Dec 15, 2021 7:22 pm
[...]
Well now I see my models again in Wings for the first time in many years. Then I used a mouse, and now I have a MacBookPro trackpad which seems a crazy new thing in Wings, seems much more difficult to control. Are there many upsides to working with Blender?

I should probably give myself a mouse for xmas. And a joystick.
Being able to see your models is good news.

Definitely, 3D modeling is still a "desktop" feat, and trackpad/touchpad or anything else than a mouse might need a learning/training effort. "They" do use graphic tablets though (see Wacom and the sorts).

The first upside when working with Blender would be that you're going to download a +200M dmg file instead of a +13M one :-D You will have a large amount of online (video) tutorials to kickstart using it out of the bat.
You will have to spend some initial time to understand what you want to use it for, how you're going to get there, and what you'll have to (heavily) skip on your way.

Shortly put, if what Wings3D is giving you is enough, consider Blender for when your schedule is cleaned up for at least a month just to understand how you'll be able to reproduce your workflow.

Also get ready to "stay tuned" with a very dynamic evolution, Blender is developed at a higher rate than Wings3D.
User avatar
Old Murgh
Wiki Wizard
Wiki Wizard
Posts: 639
Joined: Sat Dec 04, 2021 11:01 pm

Re: Model converter utilities

Post by Old Murgh »

tsoj wrote: Wed Dec 15, 2021 8:25 pm
..I can suggest a YouTube video like this.
That was a great education for me. I now move about directories in Terminal with swift ease.
Cholmondely wrote: Wed Dec 15, 2021 8:32 pm
Gsagostinho (2017): I think I am addicted to Wings3D, learned how to use it in just a few days after banging my head against Blender's wall for years.
Commander_X wrote: Wed Dec 15, 2021 9:08 pm
Shortly put, if what Wings3D is giving you is enough, consider Blender for when your schedule is cleaned up for at least a month just to understand how you'll be able to reproduce your workflow.
Yes, I should keep it in this perspective. At least start to relearn Wings before deciding to dive into a more massive endeavour. Wings was fun and satisfying for me at the level I once was, I'll just get that mouse.
Cholmondely wrote: Wed Dec 15, 2021 8:32 pm
Thrustmaster HOTAS 4 works on Mac ... I supplement it with Elgato's Streamdeck, but Arquebus prefers Touch Portal and has set up a profile for it.
That must be quite awesome. I envy your setup. I want those for xmas. And a hydraulic chair.
I was young, I was naïve. [EliteWiki] Jonny Cuba made me do it!
arquebus
---- E L I T E ----
---- E L I T E ----
Posts: 512
Joined: Sun Oct 31, 2021 6:07 am
Contact:

Re: Model converter utilities

Post by arquebus »

You can check out Touch Portal here: https://www.touch-portal.com/

It works on Windows and Mac, via iOS or Android.

It's "designed" mainly to work with things like OBS and Twitch and video software, but only insofar as there are prebuilt button interfaces for those programs. You can make your own out of whole cloth *very* easily. (So don't stress about the list of "supported software" - that's just the official button layouts).

It's a really inexpensive alternative to a Stream Deck. The main distinction being that since it's software that runs off your phone or tablet, you don't get the satisfying physical clickiness.
Here is my YouTube channel, where I play poorly: Arquebus X
User avatar
Old Murgh
Wiki Wizard
Wiki Wizard
Posts: 639
Joined: Sat Dec 04, 2021 11:01 pm

Re: Model converter utilities

Post by Old Murgh »

arquebus wrote: Wed Dec 15, 2021 9:58 pm
You can check out Touch Portal here: https://www.touch-portal.com/
Looks smart and simple, I'm curious. There is no doubt a dedicated thread where I should aim all my related questions..
I was young, I was naïve. [EliteWiki] Jonny Cuba made me do it!
arquebus
---- E L I T E ----
---- E L I T E ----
Posts: 512
Joined: Sun Oct 31, 2021 6:07 am
Contact:

Re: Model converter utilities

Post by arquebus »

Old Murgh wrote: Wed Dec 15, 2021 10:12 pm
Looks smart and simple, I'm curious. There is no doubt a dedicated thread where I should aim all my related questions..
There is not, but if you make one, I'll answer what I can!

(Alternatively, if I find time, I'll figure out if it's possible to export my layout and then link it somewhere around here.)
Here is my YouTube channel, where I play poorly: Arquebus X
User avatar
Cholmondely
Archivist
Archivist
Posts: 4997
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: Model converter utilities

Post by Cholmondely »

arquebus wrote: Thu Dec 16, 2021 12:17 am
Old Murgh wrote: Wed Dec 15, 2021 10:12 pm
Looks smart and simple, I'm curious. There is no doubt a dedicated thread where I should aim all my related questions..
There is not, but if you make one, I'll answer what I can!

(Alternatively, if I find time, I'll figure out if it's possible to export my layout and then link it somewhere around here.)
A photograph would be super if you can manage one... (or a screen shot - my pics of Elgato are all screen shots of the AppleMac's configuration tool for the StreamDeck). I must say that the one for StarTouch looks most impressive...
Last edited by Cholmondely on Thu Dec 16, 2021 12:30 am, edited 1 time in total.
Comments wanted:
Missing OXPs? What do you think is missing?
Lore: The economics of ship building How many built for Aronar?
Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
arquebus
---- E L I T E ----
---- E L I T E ----
Posts: 512
Joined: Sun Oct 31, 2021 6:07 am
Contact:

Re: Model converter utilities

Post by arquebus »

I just made a thread - I'll add a screenshot if I can figure that out. I'm currently remotely connected to my Windows PC from my MacBook at work, so this is all getting done like I'm operating a waldo.
Here is my YouTube channel, where I play poorly: Arquebus X
Post Reply