PDA

View Full Version : Preset/Surface (*.pst/*.srf) Files Format



grabiller
08-21-2012, 12:05 PM
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
08-21-2012, 12:57 PM
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
08-21-2012, 02:38 PM
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
08-21-2012, 04:05 PM
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:


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

grabiller
08-21-2012, 06:06 PM
Excellent.

Thanks a lot Mike.

Cheers,
Guy.

Lightwolf
08-22-2012, 03:13 AM
Excellent.

Thanks a lot Mike.

You're very welcome.

Cheers,
Mike

grabiller
08-22-2012, 10:57 AM
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.

nickdigital
08-22-2012, 01:11 PM
Nice, thx!

erikals
02-21-2013, 05:54 PM
...If anyone is interrested, here is the little tool I made, pretty straight forward.

Yey!!.... \ :]

Thank you :]
http://youtu.be/WRaOKOE4GvY

Matt
02-21-2013, 06:44 PM
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
02-22-2013, 01:05 AM
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!

erikals
02-22-2013, 08:46 AM
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...

zapper1998
02-22-2013, 10:15 AM
awesome thingy doo dad..

:)
Mike

dualboot
11-14-2013, 03:17 AM
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?

grabiller
11-16-2015, 06:53 AM
Hi,

As requested several times, here is an update of the custom preset thumbnail tool that works on Mac OSX. It is now x64 on both platform, even if this has no real impact though.


Here is the forum attached file: 131044

Here is the direct link to my public Dropbox: raaLwPresetThumb.v1.1.zip (https://dl.dropboxusercontent.com/u/37296168/raaLwPresetThumb.v1.1.zip)

The archive includes both the Mac OSX and Windows executables.

Cheers,
Guy.

mikadit
11-16-2015, 08:22 AM
Great. Thank you for the update!