PDA

View Full Version : Save out multiple surfaces?



bubble_boy
02-03-2009, 12:11 AM
Hey guys.

Posted this in the general support section, but no luck. So I am hoping you guys will perhaps be able to help me, or point me in the right direction.

I am looking for a plugin or something that will save out all the surfaces of an object. the actual .srf files, not the polygons. I can't find any. :(

It's getting quite depressing to save out every single surface the whole time. :D

I am using LW 9.3.1 64bit btw.

Many thanks.

xchrisx
02-03-2009, 01:45 PM
maybe I am wrong but I do not believe you can do that with Lscript. I thumbed through the documentation and I do not see any type of save surface command anywhere. Maybe one of the lscript gurus can shed some light on this.

faulknermano
02-03-2009, 07:17 PM
get a list of the surfaces of the object.



mesh = Mesh("myObject");
srf = Surface(mesh);


then use the srf array (it becomes an array because Surface returns a list of surface names for that object) to select the surface in the Surface Editor, and then save it out. in the code below the resulting surface name is set based on the surface name of the object, plus the object name, plus the "srf" extension name.



for(i=1;i<=srf.size();i++)
{
selectSrf = srf[i] + mesh.name;
cmdstr = "Surf_SetSurf " + selectSrf;
CommandInput(cmdstr);
cmdstr2 = "Surf_Save " + selectSrf + ".srf";
CommandInput(cmdstr2);
}


caution: i did not test the code above. just wrote it off my head.

xchrisx
02-03-2009, 07:20 PM
pretty cool faulknermano I will have to try that out soon. Where did you find the Surf_Save command?

faulknermano
02-03-2009, 07:26 PM
it's in the Commands.txt, but it is generated from Layout / Modeler. you can execute a Save Commands command in Layout / Modeler. I don't know where it is in the original menu layout, but it should be registered in the Edit Keys / Edit Menu panels.

also, Dodgy's lscript manual features a few of these commands (i don't know he's updated them recently). these commands are added / changed as LW is updated, too. so it's useful to always have it outputted after every LW revision, just in case.

Blochi
02-04-2009, 10:10 AM
There is also a so called Surface Library, which holds all surfaces of an object in one file. I believe the command is called "Surf_SaveLibrary", and in Surface Editor you can get to it by Right-Clicking on an object name in the lister....

Blochi

bubble_boy
02-15-2009, 01:49 AM
Thank you very much guys. I will show this to our programmer, hopefully he can make some sense of it. :)