PDA

View Full Version : LScript Commander ?



Tim Parsons
05-22-2003, 02:44 PM
I am using LScript Commander to create a macro. I do a lot of product renders (10 to 20 a day) and to facilitate workflow I generally take the product shot separately and then composite it onto a white floor background. To get the white floor with the appropriate shadows I do a load from scene in which I have a preset scene with shadow casting lights and the backdrop. At the start of my work day I create the macro within LScript Commander to automate this process of deleting current lights, setting ambient lights settings, etc. and then loading the preset shadow scene. OK here's my dilemma, executing the script from within LScript Commander works great, but if I install the script and run it from the interface I get an error saying "can't find specified server". Anybody have any ideas. I know nothing about LScript, but it sure would be handy to have this as an permanent button.

Thanks
Tim Parsons

faulknermano
05-25-2003, 08:09 PM
personally, i'd try converting the session to an lscript and then save that text into a file. load that file (which is an lscrit, actually) as a plugin and then place the item in the menus.

Tim Parsons
05-27-2003, 09:58 AM
Thanks for your input faulknermano, I tried what you suggested and still get the same errors. Works fine when executed from LScript Commander. Here is the script:


@warnings

generic
{
EditLights();
ClearAllLights();
LightIntensity(0);
AmbientIntensity(0.8);
AmbientColor(1,1,1);
LoadFromScene("M:\ActiveProjects\SWC\Lightwave\Scenes\ProductDesi gn\ShadowLightSetupScenes\ShadowLightSetUp1.lws");
RemoveServer("MasterHandler",5);
RemoveServer("MasterHandler",5);
EditServer("MasterHandler",4);
CommandInput("Generic_SpreadsheetPanel");
CommandInput("Generic_G2_Open_Master");
Antialiasing(0);
}

faulknermano
05-28-2003, 01:36 AM
hmm... you're using a scene file that i wont be able to access. but if i'm guessing correctly, the index number that you're feeding into EditServer and RemoveServer() should be subtracted by one (e.g. 5 - 1 == 4).

other than that, you could use this bit of code to look for a particular server in the master class list:




@warnings
generic
{
(found,ndx) = checkServer("ParentObjectMC");
if(found)
{
EditServer("MasterHandler",ndx);
RemoveServer("MasterHandler",ndx);
}
}
checkServer: str
{
serv = Scene().server(SERVER_MASTER_H);
for(i=1;i<=serv.size();i++)
{
if(serv[i] == str)
return(true,i);
}
return(false,i);
}


in the case of the code above, it is looing for ParentObjectMC (a master lscript). just change the name of the plugin according that which you trying to remove / edit.

hope that's relevant.

toby
06-03-2003, 08:43 PM
Same problem here - macros work when executed from the LS Commander, but not when installed, it looks like this:

@warnings

generic
{
Antialiasing(0);
}

It gives the error:
Line 6, invalid argument 1 value to Antialiasing()

It's pretty simple, unless the syntax is wrong, it's gotta be buggy ls or maybe because I'm on a Mac - ?

faulknermano
06-03-2003, 11:14 PM
Originally posted by toby
Same problem here - macros work when executed from the LS Commander, but not when installed, it looks like this:

@warnings

generic
{
Antialiasing(0);
}

It gives the error:
Line 6, invalid argument 1 value to Antialiasing()

It's pretty simple, unless the syntax is wrong, it's gotta be buggy ls or maybe because I'm on a Mac - ?

do this:


...
Antialiasing();


that is, if you want to get rid of antialiasing in the first place. it just doesnt accept a zero (0). i think this is a bug / unexpected behavior. i dunno if it's the SDK or lscript.

NanoGator
01-30-2005, 05:22 PM
I'm really late in entering the game here, but I wanted to mention something:

When putting filepaths into strings, instead of using \ use \\. \\ means the same as \, but \ is used with other characters to show other strings.