Base Class Interfaces

These classes are inherited by the handler interfaces. (see Handler Interfaces)

Note

These base classes are not intended for direct usage; rather they are inherited by handler classes, which are themselves intended to be subclassed by you in your Python script. (see Anatomy of a LightWave Python Plug-in)

IPlugin

This class is the “superclass” from which all other classes inherit. At this time, it provides no functionality beyond providing a base type for all plug-in subclasses.

class lwsdk.IPlugin

Bases: object

Proxy of C++ PCore::IPlugin class

Handler Interfaces

class lwsdk.IHandlerFuncs

Bases: lwsdk.IPlugin

Proxy of C++ PCore::IHandlerFuncs class

 inst_acquire()

This Python-only callback method may be used by the script as a boundary function to know when it is safe to acquire resources that may cause the script instance to be "locked" by the Python interpreter. Such "locking" occurs as reference counts to script elements accumulate. If any such locks exist on resources when the script is ready to terminate, the Python class destructor method (__del__()) will not be invoked, and the script instance will languish in memory, unused by consuming memory and resources. In this arrangement, the IHandlerFuncs::inst_release() becomes functionally equivalent to the __del__() destructor method, but is guaranteed to be called (whereas the destructor may not be if "locks" exist).

The "ring_test.py" example Python plug-in uses this method to attach to the communication channel, and it is released when the corresponding IHandlerFuncs::inst_release() method is invoked. The use of a callback (which is a required parameter to the LWComRing::ringAttach() method) causes a "lock" on the class instance within the Python interpreter. Only by calling the LWComRing::ringDetach() method in IHandlerFuncs::inst_release() callback will that particular "lock" be freed, and the script instance made available for reclamation.

 inst_copy(PyObject src) → LWError

This callback is invoked when a copy of your script instance is being made by LightWave. Copy the salient elements from your script instance into the one provided.

Return None if there were no issues with the copy, or return a character string with pertinent information to indicate an error.

 inst_descln() → char

The return value of this callback is a description (as a character string) of your plug-in that will be displayed to the user on the Plug-in panel. Since this callback will be used whenever that information needs to be refreshed, you may include information about active settings or states within the returned string to keep the user informed.

 inst_load(LWLoadState arg0) → LWError

This callback is invoked by LightWave after your script has been activated from an in-progress scene or object load. It indicates that the load has progressed to a point where you can use the provided LWLoadState class instance to read in settings your plug-in may have previously stored using IHandlerFuncs::inst_save().

 inst_release()

This Python-only callback method is invoked by PCore when termination of the script is imminent, but before the actual destruction of the script instance. Within this callback, you should release all "locked" resources you may have acquired in the IHandlerFuncs::inst_acquire() method.

 inst_save(LWSaveState arg0) → LWError

This callback is invoked by LightWave after the presence of your script has been stored into an in-progress scene or object save. At the point the callback is activated, you may use the provided LWSaveState class instance to write your settings into the scene or object file.

class lwsdk.IInterfaceFuncs

Bases: object

Proxy of C++ PCore::IInterfaceFuncs class

 inter_ui() → int

When the user indicates a wish to interact with your plug-ins Graphical User Interface (GUI), this callback will be invoked. Within this callback, you should create an instance of your GUI, post it to the user to manipulate, and then update your script's operational parameters from the result, if indicated.

Several of the included Python example plug-in scripts implement this callback and provide GUIs so their data may be modified by the user.

 inter_xpanel() → LWXPanelID

!! NOT IMPLEMENTED !!

class lwsdk.IGizmoFuncs

Bases: object

Proxy of C++ PCore::IGizmoFuncs class

 gizmo_adjust(LWToolEvent arg0, int arg1) → int
 gizmo_count(LWToolEvent arg0) → int
 gizmo_dirty() → int
 gizmo_done()
 gizmo_down(LWToolEvent arg0) → int
 gizmo_draw(LWCustomObjAccess arg0)
 gizmo_event(int arg0)
 gizmo_handle(LWToolEvent arg0, int arg1, LWDVector arg2) → int
 gizmo_help(LWToolEvent arg0) → char
 gizmo_move(LWToolEvent arg0)
 gizmo_panel() → LWXPanelID
 gizmo_start(LWToolEvent arg0) → int
 gizmo_up(LWToolEvent arg0)
class lwsdk.IItemFuncs

Bases: object

Proxy of C++ PCore::IItemFuncs class

 item_changeID(LWItemID arg0)

Object's in a LightWave scene all have unique "object identifiers" (or "object ids") associated with them. If it ever happens that a scene object has its identifier altered (as may be the case in, for example, a load-from-scene situation), this callback will be invoked with a sequence of LWItemID pairs, with the first id of each pair representing the "before" value, and the second, the "after" value.

 item_changeName(arg0)

!! NOT DOCUMENTED !!

 item_useItems() → LWItemID

When called, LightWave is querying the plug-in for information about the objects in which it takes an active interest. A sequence containing one or more LWItemID values should be returned, or None if this is not applicable.

class lwsdk.IRenderFuncs

Bases: object

Proxy of C++ PCore::IRenderFuncs class

 rend_cleanup()

Called after the last frame of a rendering session is completed.

 rend_init(int arg0) → LWError

This is a boundary callback that lets the plug-in know that a rendering operation is about to begin. This is called before the first frame of a rendering session is begun. arg0 will be either lwsdk.LWINIT_PREVIEW or lwsdk.LWINIT_RENDER. Returns a string containing an error message if an error occurs, otherwise returns None.

 rend_newTime(LWFrame arg0, LWTime arg1) → LWError

Called at the start of a new sampling pass. This may be called more than once for the same frame but for slightly different times. Returns an error message string, or None.

class lwsdk.ILayoutToolFuncs

Bases: object

Proxy of C++ PCore::ILayoutToolFuncs class

 tool_adjust(LWToolEvent arg0, int arg1) → int
 tool_count(LWToolEvent arg0) → int
 tool_dirty() → int
 tool_done()
 tool_down(LWToolEvent arg0) → int
 tool_draw(LWCustomObjAccess arg0)
 tool_event(int arg0)
 tool_handle(LWToolEvent arg0, int arg1, LWDVector arg2) → int
 tool_help(LWToolEvent arg0) → char
 tool_move(LWToolEvent arg0)
 tool_panel() → LWXPanelID
 tool_start(LWToolEvent arg0) → int
 tool_up(LWToolEvent arg0)

Factory Interfaces

For the most part, Factories are mechanisms that serve their purpose without the need for your direct usage of them. Creating instances of them, and providing them in your ServerRecord is sufficient.

However, you may subclass a Factory Interface to implement your own special functionality (as long as you retain the base functionality of the interface). The “master_test.py” example Python plug-in actually performs such a subclassing of its Factory Interface to provide some additional functionality. Please refer to that script for more details.

Note

Factory Interfaces are documented here only for completeness.

class lwsdk.IFactoryFuncs

Bases: object

Proxy of C++ PCore::IFactoryFuncs class

 destroy(PyObject arg0)
 name() → char
class lwsdk.ICommandSequenceFactory

Bases: lwsdk.IFactoryFuncs

Proxy of C++ PCore::ICommandSequenceFactory class

 create(PyObject context) → PyObject
 destroy(PyObject arg0)
 name() → char
class lwsdk.IGenericFactory

Bases: lwsdk.IFactoryFuncs

Proxy of C++ PCore::IGenericFactory class

 create(PyObject context) → PyObject
 destroy(PyObject arg0)
 name() → char
class lwsdk.IImageLoaderFactory

Bases: lwsdk.IFactoryFuncs

Proxy of C++ PCore::IImageLoaderFactory class

 create(PyObject context) → PyObject
 destroy(PyObject arg0)
 name() → char
class lwsdk.IImageSaverFactory

Bases: lwsdk.IFactoryFuncs

Proxy of C++ PCore::IImageSaverFactory class

 create(PyObject context, LWImageSaverLocal imagesaver_local) → PyObject
 destroy(PyObject arg0)
 name() → char
class lwsdk.IEnvironmentFactory

Bases: lwsdk.IFactoryFuncs

Proxy of C++ PCore::IEnvironmentFactory class

 create(PyObject context) → PyObject
 destroy(PyObject arg0)
 name() → char
class lwsdk.IShaderFactory

Bases: lwsdk.IFactoryFuncs

Proxy of C++ PCore::IShaderFactory class

 create(PyObject context) → PyObject
 destroy(PyObject arg0)
 name() → char
class lwsdk.IObjReplacementFactory

Bases: lwsdk.IFactoryFuncs

Proxy of C++ PCore::IObjReplacementFactory class

 create(PyObject context) → PyObject
 destroy(PyObject arg0)
 name() → char
class lwsdk.IDisplacementFactory

Bases: lwsdk.IFactoryFuncs

Proxy of C++ PCore::IDisplacementFactory class

 create(PyObject context) → PyObject
 destroy(PyObject arg0)
 name() → char
class lwsdk.IInstancerFactory

Bases: lwsdk.IFactoryFuncs

Proxy of C++ PCore::IInstancerFactory class

 create(PyObject context) → PyObject
 destroy(PyObject arg0)
 name() → char
class lwsdk.ILayoutToolFactory

Bases: lwsdk.IFactoryFuncs

Proxy of C++ PCore::ILayoutToolFactory class

 create(PyObject context) → PyObject
 destroy(PyObject arg0)
 name() → char
class lwsdk.INodeFactory

Bases: lwsdk.IFactoryFuncs

Proxy of C++ PCore::INodeFactory class

 create(PyObject context) → PyObject
 destroy(PyObject arg0)
 name() → char
class lwsdk.IChannelFactory

Bases: lwsdk.IFactoryFuncs

Proxy of C++ PCore::IChannelFactory class

 create(PyObject context) → PyObject
 destroy(PyObject arg0)
 name() → char
class lwsdk.IItemMotionFactory

Bases: lwsdk.IFactoryFuncs

Proxy of C++ PCore::IItemMotionFactory class

 create(PyObject context) → PyObject
 destroy(PyObject arg0)
 name() → char
class lwsdk.IMasterFactory

Bases: lwsdk.IFactoryFuncs

Proxy of C++ PCore::IMasterFactory class

 create(PyObject context) → PyObject
 destroy(PyObject arg0)
 name() → char
class lwsdk.IFrameBufferFactory

Bases: lwsdk.IFactoryFuncs

Proxy of C++ PCore::IFrameBufferFactory class

 create(PyObject context) → PyObject
 destroy(PyObject arg0)
 name() → char
class lwsdk.ICustomObjFactory

Bases: lwsdk.IFactoryFuncs

Proxy of C++ PCore::ICustomObjFactory class

 create(PyObject context) → PyObject
 destroy(PyObject arg0)
 name() → char
class lwsdk.IImageFilterFactory

Bases: lwsdk.IFactoryFuncs

Proxy of C++ PCore::IImageFilterFactory class

 create(PyObject context) → PyObject
 destroy(PyObject arg0)
 name() → char

Table Of Contents

Previous topic

The Python ‘lwsdk’ Module

Next topic

Handler Interfaces

This Page