Note
These interface classes are not intended for direct usage; rather they should be inherited by your own subclass. (See Anatomy of a LightWave Python Plug-in)
Bases: lwsdk.lwsdk.IHandlerFuncs
Proxy of C++ PCore::ICommandSequence class
CommandSequence plug-ins are of the "single-shot" type. This is the entry point where CommandSequence-class plug-ins perform all their actions.
The return value indicates the success or failure of the operation. In most cases, you're going to return lwsdk.AFUNC_OK
, and indicate processing errors through other means.
Bases: object
Proxy of C++ PCore::LWModCommand class
Users and other plug-ins can invoke your plug-in with arguments, which are stored here as a string. If there are no arguments, then this value will be None.
This is an opaque pointer to data used internally by Modeler. Pass this as the first argument to the LWModCommand::lookup()
, LWModCommand::execute()
and LWModCommand::evaluate()
methods.
Begin a mesh edit. The buffer sizes are used to create temporary buffers associated with each point and polygon. Modeler allocates and frees this memory for you, and you can use it for any per-point or per-polygon data you might need during the edit. Points and polygons are flagged as selected according to the code you pass in the select
parameter.
!! NOT DOCUMENTED !!
Issue the command with the name and arguments in the command string. This is an alternative to using LWModCommand::lookup()
and LWModCommand::execute()
. The command and its arguments are written to a single string and delimited by spaces.
Issue the command given by the command code argument. py_dyna_values
is an array of DynaValue
arguments. The selection determines which geometry will be affected by the command and can be any one of the EltOpSelect codes, except lwsdk.OPSEL_MODIFY
.
Returns an integer code corresponding to the command name. The command is issued by passing the command code to the LWModCommand::execute()
method. Command codes are constant for a given Modeler session, so this only needs to be called once per command, after which the codes can be cached and then used in any number of calls to LWModCommand::execute()
.
This allows for multiple actions to be classified under a single undo operation. Call this before the first action.
Call this to complete a series of actions that are part of a single undo group.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | class make_test(lwsdk.ICommandSequence):
def __init__(self, context):
super(make_test, self).__init__()
self._radius = lwsdk.Vector(0.5, 0.5, 0.5)
self._nsides = 24
self._nsegments = 12
self._center = lwsdk.Vector(0.0, 0.0, 0.0)
# LWCommandSequence -----------------------------------
def process(self, mod_command):
cs_options = lwsdk.marshall_dynavalues((self._radius, self._nsides, self._nsegments, self._center))
[...]
ServerRecord = { lwsdk.CommandSequenceFactory("LW_PyMakeTest", make_test) : ServerTagInfo }
|