PDA

View Full Version : Modifing texture parameters using LScript



Julius Caesar
02-17-2003, 08:57 AM
Hello all,
I am wondering if anyone knows how to change texture parameters in Modeler like Color, Image, Diffusion, Bump and other values etc using LWScript. I would like to create a script that changes these values on several models/object using a LW Script.
I know that it did exist a Include for the LW 5.5.. Do we have something for the 7.5?
Thank you and best regards

Julius

Halsu
02-17-2003, 03:08 PM
I'd like to see an answer to this too...

I tried to search the docs about these, but haven't found anything smart yet.

I now know how to READ the values though ,-)

main
{
Object = Mesh();
ObjectSurfaces = (Surface(Object));
CurSurf = Surface(ObjectSurfaces[1]);
info(CurSurf.getValue(SURFCOLR));
}


...and while at it, is there a way to make UVmaps with LScript ?

faulknermano
02-18-2003, 12:53 AM
generic
{
reqbegin("Random Color");

c1 = ctlstring("Surface Prefix","RandSurf_");

return if(!reqpost());

surfName = getvalue(c1);

reqend();

m = Scene().firstSelect();
if(m.genus != MESH)
error("Select a mesh.");
so = Surface(m);
foreach(s,so)
{
found = searchExp(s,surfName);
if(!found)
continue;

a = random(0,255) / 255;
b = random(0,255) / 255;
c = random(0,255) / 255;
string("Surf_SetSurf ",s," ",m.name);
CommandInput(this);
string("Surf_SetColor BaseColor ",a," ",b," ",c);
CommandInput(this);
}
}

this is part of the RandomColorGN script i made. you cannot change surface parameters within modeler (sucks, eh?) so you have to go to layout for that. you will have to use CS commands to do so. do not run the script, because it is lacking a search and replace UDF. just pick out what you need from there.

good luck.

faulknermano
02-18-2003, 12:56 AM
Originally posted by Halsu


...and while at it, is there a way to make UVmaps with LScript ?

yes.. it's still under the Vertex Maps Object agent. UV vmaps two float slots. check the docs at the chapter called "Vertex Map Object Agent".

Julius Caesar
02-18-2003, 01:24 AM
WOW!!!!
Thank you very much for your script, Faulknermano!!!!
That opens new possibility for my work!!!!! I really appreciated the script you posted.... I will definitively use that ***very*** soon... I will, of course, put a REM in the script with a credit for you!!!

Best regards

Julius

Halsu
02-18-2003, 02:50 AM
Thanks for the info!!