Python Plugin Structure

Last modified: 10 March 2025

In this section, we will begin our introduction of LightWave Python by dissecting a Modeler Command Sequence script included with LightWave.

This example script is called “Enumerate Surfaces”, and its task is to identify all surfaces defined for all selected polygons, and append a sequential numeric value to each. We shall look at the individual pieces of the script, but at any time, you should feel free to load the script into your favorite text editor to see the plug-in source code as a whole.

All example Python scripts are formatted according to the recommended Python module organization. (see also this stackoverflow article

It is important that you are aware that, with few exceptions, certain plug-in elements that will be included in this analysis are absolutely required for an external Python script to be considered a LightWave plug-in. Having said that, however, there are some exceptions to this rule, and they are considered “single-shot” plug-in types. These type exceptions (introduced in LightWave v11.5) are discussed in the “Single-Shot” Exceptions section.