Basic LScript in Lightwave3D 7.x
 
by Matt Raithel
 
Lscripting is pretty basic procedure in Lightwave, but like many things in the program it looks much more complicated that it really is. Lscripting is really an action recorder within Lightwave that can be utilized to make specific actions quickly repeatable. This is similar to Photoshop's Action panel.
 
1.
To begin making your own Lscripts and eventually your own buttons in Lightwave, open up Layout. Next go to Layout>Plug-ins>Master Plug-ins (image 1). A new window will pop up called Master Plug-ins.
 
2.
Click on the pull-down menu Add Layout or Scene Master, and choose Lscript commander (image2). Then, double click on the words LScript Commander. A new window pops up called LScript Commander v1.0 (image 3).
 
3.
The commander is now recording your actions and logging them in the command window of the LScript commander. For this tutorial, we are going to make a LScript that toggles a custom gradient backdrop. To begin logging actions to use in our script, click on the scene tab and then backdrop (image 4).
 
4.
Notice that the word "backdrop" now appears in the LScript command window. Next check the Gradient Backdrop option and notice that too was added in the LScript command window.
 
5.
Now choose new colors for your custom gradient backdrop. For this tutorial I used [ooo,o4o,o8o] as the Zenith color, and [12o,18o,24o] for the Sky Color, Ground Color and Nadir Color. Leave the Sky Squeeze and Ground Squeeze at 2.0 (image 5).
 
6.
Even though I didn't change the Zenith Color from it's default I still chose and selected the color again so that it is logged into the LScript commander.
 
7.

Now that we have our actions we can build our script. Begin by right-clicking on each item you want to be executed when you run the LScript. Each item will be added to the commander window in yellow text over the black background.
When finished, it should look something like this:

GradientBackdrop
SkyColor 0.470588 0.705882 0.941176
GroundColor 0.470588 0.705882 0.941176
NadirColor 0.470588 0.705882 0.941176
ZenithColor 0 0.156863 0.309804

This tells the computer to toggle the Gradient Backdrop (if it is already on this will turn it off), and change the Sky,Ground,Nadir, and Zenith colors to the specified values.
Make sure your Backdrop panel is still open to see the effects and you can test the script by clicking on the Execute button in the LScript commander window. Notice that each time you click execute the Gradient Backdrop option toggles on and off. This is ok for now, so we will move to the next step, which is compiling the script.

 
8.
Click the Install button in the LScript commander window and a new window will pop-up and ask you to name your new script. I choose Blue Sky for this tutorial. Click ok and notice that a message will tell you that your script is compiled and installed (image 6).
 
9.
Your LScript now resides in button form in the LScript tab under Macros (image 7).
 
 
This can be a process that can save you lots of time depending on the type of work you are doing. Other basic uses include saving pre-made render settings, antialiasing and blur configurations, object cloning sequences. This can also be used to create lights with pre-selected features such as adding a spotlight set to use shadow maps with a 2048 resolution, and specific light color, intensity and cone angle, each time you click the button. When building your own LScripts, understand that the script executes in the order it is seen in the commander window (window with yellow text and black background) not necessarily the order in which you performed each action.