Layout Tool Class

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)

Handler

class lwsdk.ILayoutTool(self)

Bases: lwsdk.lwsdk.IHandlerFuncs, lwsdk.lwsdk.ILayoutToolFuncs

Proxy of C++ PCore::ILayoutTool class

Factory

class lwsdk.LayoutToolFactory(name, klass)

Bases: lwsdk.lwsdk.ILayoutToolFactory

Default Python Factory for ILayoutTool

 create(context)
 destroy(instance)

Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
class split_bone(lwsdk.ILayoutTool):
    def __init__(self, context):
        super(split_bone, self).__init__()
        # context has no relevant value in a LayoutTool plug-in

        self._item_info      = lwsdk.LWItemInfo()
        self._bone_info      = lwsdk.LWBoneInfo()
[...]
    # LWLayoutTool ----------------------------------------
    def tool_draw(self, ca):
        self._bones = self.get_current_bones()
        cur_time = lwsdk.LWInterfaceInfo().curTime

        for bone in self._bones:
            if bone.type == lwsdk.LWBONETYPE_ZAXIS:
                len = bone.restlength;
                dir = Vector(0,0,1)
[...]
ServerRecord = { lwsdk.LayoutToolFactory("LW_PySplitBone", split_bone) : ServerTagInfo }

Table Of Contents

Previous topic

Instancer Class

Next topic

Node Class (Shader)

This Page