fun with .pso

More
18 years 5 months ago #14125 by Second Chance
Replied by Second Chance on topic fun with .pso
You are correct Jasper, the Lightwave scene files do exactly what you think in Layout. I think Shane was asking because you would still need Lightwave to open these files and view a whole ship, or build one using this method (and as Shane pointed out, most of the EoC ships are made this way). I've seen several free Lightwave scene viewers, but I doubt if they write .lws files.

Using Layout is pretty much integral to building anything complex with Lightwave, so if you could write something to read the .lws files and get the translation matrix for each mesh and light in the scene and convert them to a useable file format, you could then open whole avatar and setup scenes in Blender or whatever you're using.

And if you can open them, you might as well be able to edit and save them. So just reverse the process and convert the translation matices back into an .lws file

As I mentioned earlier, most 3D programs integrate scene setup with mesh construction, but Lightwave splits these functions up into two different programs. So, if you want to build or view complete avatar and setup scenes for EoC in another program, you're going to have to combine the necessary .lwo and .lws files into a single file that your program can open. And then write another program that converts your Blender (or whatever) file back into the equivilent of an .lws file. (This shouldn't be too hard for you, just look in an .lws file to see what's needed.) If you could get your Blender objects coverted to properly surfaced .lwo meshes as well, so much the better.

Excellent, excellent work, btw. Truly important in the scope of EoC modding.

*edit*
All newer versions of Lightwave (except 6.0) can export to 5.6 format, but the all important glow and reflection channels don't work. That's why having 5.6 is generally such an issue.

mailto:second_chance@cox.net
The Ultimate Guide To Modding: I-War 2 - Edge Of Chaos
.

Please Log in or Create an account to join the conversation.

More
18 years 5 months ago #14126 by Shane
Replied by Shane on topic fun with .pso

I'm not sure i understand - once you've got the .lwo's dosn't the LW Layout thing just work?

Sorry... I was unclear. Yes, with the .pso's converted to .lwo the Lightwave Scenes work just fine. I didn't know if you knew some of the models are broken up across several pso files, while other models are all one piece.

Havign LW 7.5 only may not be that much of an issue, or can it not export ver 5.6 files, and only import?

Bingo. It can import fine. But when a file is exported from 7.5 to 5.6 it looses surface properties (they are all set to default of zero and textures are not assigned).

Hmm, which files are a problem? i'll write a wrapper to try to convert all the .pso files in eoc, and then look for problem ones tommorow.

Attempting to translate the fueltransporter/Cab_RTO_LOD0_T.PSO results in the error "DARN vertsz wrong for cab_rto_lod0_t.pso". This is by far the most common error I've encountered converting PSO's.



Attempting to convert 1_TroopCarrier_T.PSO has this error:





Attempting to convert puffin_tug/Puffin0_T.PSO hangs my computer. The conversion gets about halfway and then some strange symbols appear as everything grinds to a halt. Even after I manage to quit the program everything's choppy until I reboot.

Please Log in or Create an account to join the conversation.

More
18 years 5 months ago #14129 by Jasper
Replied by Jasper on topic fun with .pso
Arrgh!

The .exe are produced from the python scripts using a thing called py2exe, which i assumed would just work.

But trying the .exe's my self and comparing the results to the scripts has the same problems you do.

The .exe's are broken. :(!:(!:(!

Bah, eaisest solution is to grab python:

www.python.org/2.4.2/

and use that with the scripts.

(i'm using 2.4.1 but it shouldn't make any difference).

I'll see if there is a newer version of py2exe or if anyone has had the same problem.

---
If there is hope it lies with the demo scene.
PSO and FTEX tools: pointless.net/eoc/

Please Log in or Create an account to join the conversation.

More
18 years 5 months ago #14130 by Jasper
Replied by Jasper on topic fun with .pso
New version - in the SRFS chunk in a LWOB pad the strings to the next 16 bit boundry.

pointless.net/eoc/psotools-python.zip

---
If there is hope it lies with the demo scene.
PSO and FTEX tools: pointless.net/eoc/

Please Log in or Create an account to join the conversation.

More
18 years 5 months ago #14144 by Shane
Replied by Shane on topic fun with .pso
Hi Jasper.

I see the new version is highly Python based. I downloaded and installed Python 2.4, but I'm not versed in it at all. (In fact, currently I'm only capable of some low-level C++ and POG.)

Are there any special steps which I should be doing with the new Python version? Or just treat the LoadIFF.py as I did the LoadIFF.exe (via command prompt)?

Thanks. :)

Please Log in or Create an account to join the conversation.

More
18 years 5 months ago #14146 by Jasper
Replied by Jasper on topic fun with .pso

Originally posted by Shane

Hi Jasper.

I see the new version is highly Python based. I downloaded and installed Python 2.4, but I'm not versed in it at all. (In fact, currently I'm only capable of some low-level C++ and POG.)

Are there any special steps which I should be doing with the new Python version? Or just treat the LoadIFF.py as I did the LoadIFF.exe (via command prompt)?

Thanks. :)


Yes, that should work fine, except it dosn't.

Grrr.

A bit of background here:

I usualy work under one or another unix system, so i do most of my stuff on windows under something called cygwin, which gives a nice unix environment on windows.

Now cygwin comes with python, but dosn't support OpenGL on python, so i've also got the windows native port of python on my machine (which i need for py2exe too).

After trying the scripts a few times I've found some circumstances where the windows and cygwin build of python will do different things with the same script, which is a pain in the neck.

It looks like it's something to do with open and closing the same file multiple times.

Fixed now.

Ahh, looks like that was what was causing problems with py2exe, the .exe's look like they work now.

ok, so new version, both .exe and py included.

I'm in the middle of reorganising the code so some of the names have changed:
  • lwo-info.exe will dump out all the chunks and subchunks in a .lwo


  • PSO takes a .pso and writes out an .lwo (and the points file) - i'm in the process of splitting this into pso2lwo and pso2points


  • psotextool - this takes a .pso and generates a .tex if one dosn't exists, if it does it generates a new pso with the textures changed, useful for reskinning things.

pointless.net/eoc/psotools.zip

---
If there is hope it lies with the demo scene.
PSO and FTEX tools: pointless.net/eoc/

Please Log in or Create an account to join the conversation.