PDA

View Full Version : replace all surfaces lscript?



littleloud
08-29-2008, 02:58 AM
hi all

can anybody point me in the direction of a way to replace all surfaces in a scene with a .srf/.pst?

preferably without saving the objects with the new surface?

any thoughts would be real helpful


ta

Otterman
08-29-2008, 03:06 AM
sorry wrong post-OOps

jeremyhardin
08-29-2008, 05:15 AM
you can use the surface editor commands to set any surface as current and load an SRF file.

so you'd loop through each object, loop through each surface, and load the SRF file onto the surface one at a time.

jeremyhardin
08-30-2008, 07:52 AM
Here's an example script I did a while back that might help you get started. It gives the user the selected surface in the surface editor.

http://newtek.com/forums/showthread.php?t=58670

MentalFish
09-12-2008, 05:01 AM
I am trying to do something similar in Modeler, loading an SRF file to replace the settings of an existing surface:

I have a blank surface named LightMapped and I want to "overwrite" it with a SRF file. How to go about? I have been searching the forum and scanning the docs, but nothing in sight so far.

MentalFish
09-12-2008, 05:54 AM
Some more googling and I found this:
http://www.interialabs.de/lw/lscript/files/IL_SurfLibs_101.zip

With another round of googling leading me to this:
http://www.davidikeda.com/skelescript/native_reference.html

And now I can load SRF files by using this:
CommandInput("Surf_Load \"path/to/my.srf\"");

:thumbsup:

jeremyhardin
09-12-2008, 06:20 AM
Some more googling and I found this:
http://www.interialabs.de/lw/lscript/files/IL_SurfLibs_101.zip

With another round of googling leading me to this:
http://www.davidikeda.com/skelescript/native_reference.html

And now I can load SRF files by using this:
CommandInput("Surf_Load \"path/to/my.srf\"");

:thumbsup:

That command list you linked to is available straight from layout by choosing Save Command List or some such. It outputs a simple text file for you. Additionally, I think they're all viewable in LSCommander.

zardoz
09-12-2008, 07:23 AM
hmm...I may be missing something here but can't you just load the surface/add it to presets and then in the surface panel change from "edit by Object" to "edit by Scene" and then choose all the surfaces and double click on the one you want in the presets...or pasting from another surface?

jeremyhardin
09-12-2008, 08:33 AM
missing the point of automation there though. :)

MentalFish
09-12-2008, 01:41 PM
I am making a one-button-solution between LightWave and Unity when it comes to exporting two OBJ files. What I do is I take the colour model and copy paste it to a new layer, load the light map surface and apply it to the model, export to OBJ, delete the layer and launch Unity via a C++ plugin i made. Inside Unity I have made an import-interrupt script that transfers the UVs from the light map OBJ and applies its texture as the second texture layer on the colour OBJ. It looks like magic, automagic :)