The Python ‘lwsdk’ Module

The Python-based interface to the LightWave Python integration combined into a single import module called ‘lwsdk’. This module provides the elements and classes you will use to construct your LightWave Python plug-ins.

Note

The documentation found within these pages have been automatically generated from the Python code that itself was automatically generated by the PCore wrapper layer. If you do your own research, you may find that not all elements available from the wrapper layer have been documented here. This is because an attempt has been made to present only those elements from this layer that will be relevant to you when writing LightWave Python plug-ins.

Element Purpose

Where appropriate, each documented element has a icon associated with it that indicates its type and intended purpose.

_images/ro_attribute.jpg

A read-only class attribute.

It may not always be the case that the attribute is directly accessible using the class instance. Such exceptions will be noted within the documentation.

_images/rw_attribute.jpg

A read-write class attribute.

The value in the attribute may have value to the script, and it can be overwritten to be provided back to LightWave.

_images/wo_attribute.jpg

A write-only class attribute.

Values may be stored within this attribute for transport back to LightWave.

Note

In the case of read-write and write-only class attributes, it is important to realize that values are not provided back to LightWave until the class or global instance goes out of scope.

_images/convenience.jpg

A “convenience” method.

Convenience methods perform tasks on your behalf: execute commands, modify or retrieve geometric data, set or query states, etc. Convenience methods can be provided by the LightWave SDK (e.g., in an “access” class), or they can be provided by the PCore wrapper layer in order to improve performance. As a general rule of thumb, a convenience method (or function) is any method that isn’t a “callback.”

_images/callback.jpg

A “callback” method.

When you see this icon, the method is a “callback” that will be invoked by LightWave to allow your plug-in to perform its programmed functions. Your subclass should override these methods in order to be invoked by LightWave.

_images/python_glassy.jpg

A Python-only method.

This icon indicates that the method is available only within the Python environment, most likely having been added to assist in conversions to/from data types, or to simplify overly complex interfaces.

_images/deprecated.jpg

A deprecated element.

This icon indicates that the element – method, data member or class – has been deprecated in this release of LightWave Python, and will be removed in a later release. You should update any existing scripts that rely on this element if you plan to use them with this release, and you should not employ this element in new works to ensure future compatibility.

Base Classes

Base classes are designed to house functionality that is common to a series of other classes (e.g., handler classes). Base classes (or “super classes”) support polymorphism, and promote code re-use, in object-oriented programming. They are not typically intended to be used directly; their functionality becomes available within those classes who inherit from them (known as “child” or “derived” classes).

Handler Classes

Handler classes define interfaces used by LightWave to implement each of its supported plug-in architectures. These classes are themselves “derived” from one or more Base classes, and as with the Base classes, are intended to act as “parent” classes from which your Python classes will inherit to define their functionality (see Anatomy of a LightWave Python Plug-in).

Each Handler page will also provide an overview of any “access” classes which might be associated with the architecture, if any.

Global Classes

Globals class instances provide architecture-independent data and methods that give insight into, or control over, aspects of the overall environment. Global instances may be created as needed by a Python plug-in.

Miscellaneous Classes

This section picks up the remaining entries that do not belong to any other organized category.

Table Of Contents

Previous topic

Anatomy of a LightWave Python Plug-in

Next topic

Base Class Interfaces

This Page