Preset/Surface (*.pst/*.srf) Files Format

grabiller

New member
Hi,

Perhaps it's more appropriate to post it here rather than in the "LW- Community" forum:

I'm not sure if this has been allready discussed, I'm looking for the specifications of the preset/surface binary files format.

I need to create a tool to embed custom images in those files to replace the default ones.

Does anyone know where I can find these files format description, or perhaps there is allready a tool to do this ?

Thanks in advance for any help.

Cheers,
Guy.
 

Lightwolf

obfuscated SDK hacker
I did help out in writing a .pst parser for presetcentral in PHP - I'll have to search for my source code though.

As far as I remember the images are in a single IFF chunk, stored as uncompressed RGB - so they should be easy to replace from the outside once you find the chunk.

Cheers,
Mike
 

grabiller

New member
Thanks Mike for the infos.

Do you recall the chunk offset/size, the picture size and the color format (Int32 ?) ?

I think with those informations I should be fine.

Cheers,
Guy.
 

Lightwolf

obfuscated SDK hacker
Thanks Mike for the infos.

Do you recall the chunk offset/size, the picture size and the color format (Int32 ?) ?
I actually found the code. This basically writes the data found in the THUM chunk into a PHP array:
Code:
                case "THUM":
                    $nBytes = $this->readWord();
                    $return["Thumb"]["X"] = $this->readWord();
                    $return["Thumb"]["Y"] = $this->readWord();
                    $return["Thumb"]["Bitmap"] = $this->readChunk($nBytes - 8);
                    break;
The pixel format is unsigned bytes, RGB.

Cheers,
Mike
 
Last edited:

grabiller

New member
Hi,

If anyone is interrested, here is the little tool I made, pretty straight forward.

Just drop a Lightwave Preset file on the left, an image on the right and press the button.

Should work with bmp, tga, tiff, jpg, jpeg2000, png (use 24bit images, no transparency).

If there are any problem with it, don't hesitate to tell me.

Cheers,
Guy.
 

Attachments

  • raaLwPresetThumb.zip
    315.2 KB · Views: 762
Last edited:

Matt

Valiant NewTeKnight
Great stuff, eventually I want to be able to do this in LW, as long as using last render (both VPR and F9) to create thumbnails for presets. Will be needed when VIPER is retired completely (as that's the last thing it can do that VPR can't right now).
 

khan973

Lightwave Vampire
Thanks Guy!
That's a great idea Matt!
LW could have its own scene for working on presets so we can save a "standardized" thumbnail.
To me presets are a whole subject that would require LW3DG to invest some time in.

A few ideas:
- Get a specific LightWave preset scene (w/o GI and with GI
- Replace the aweful old surfaces we have with realistic, cartoon ones
- Be able to view on the preset Thumbnail which preset has nodes (with a little N overlayed)
- Be able to drag / drop from a web page (later, we could just add Urls that open a list of presets)
- Get a "package surface" feature that catches all the textures used in the preset and put them in the preset folder
- Bigger Preset Thumbnails
- Yes, definitely a "save as - Surface / Hypervoxel / Background - preset Thumbnail " feature (that would be a resized square cropped)

That would be a good start and a nice evolution!
 
Last edited:
and face expressions thumbnails (just a "small" request there) :]
(or maybe that is a plugin of it's own)

+ drag-drop preset onto surface...

search function would be nice...
 

Attachments

  • 8380227559_c4dae2a998.jpg
    8380227559_c4dae2a998.jpg
    161.7 KB · Views: 310
Last edited:

dualboot

New member
Great work guys...since the subject is similar to this I will not open the new thread, but rather ask here. I found my old Lightwave 9 content disc and found a folder full of .srf files that I would like add to current Lightwave iteration. Is there a .srf to .pst converter...plugin or script, or do I have to do it manually one at the time by buildng an object load the .srf and then save it as .pst?
 
Top Bottom