Channel 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.IChannel

Bases: lwsdk.lwsdk.IHandlerFuncs, lwsdk.lwsdk.IInterfaceFuncs, lwsdk.lwsdk.IGizmoFuncs, lwsdk.lwsdk.IItemFuncs

Proxy of C++ PCore::IChannel class

 evaluate(LWChannelAccess arg0)

The channel value is examined and modified at each time step using methods in the LWChannelAccess class instance (described below).

 flags() → unsigned int

Returns an integer containing bit flags combined using bitwise-or. No flags are currently defined or channel handlers, so this should return 0.

Access

class lwsdk.LWChannelAccess(*args)

Bases: object

Proxy of C++ PCore::LWChannelAccess class

 chan → LWChannelID

This is the identifier for the channel to which the script instance has been assigned.

 channelName(LWChannelID chan) → char

Returns the name associated with the channel ID in LWChannelAccess::chan.

 frame → LWFrame

The frame number of the evaluation.

 getChannel(LWChannelID chan, LWTime t)

Retrieves a value from a channel at the indicated time.

 setChannel(LWChannelID chan, double value)

Sets the value of the channel.

 time → LWTime

The time of the evaluation, in seconds.

 value → double

The current value of the channel at the given time.

Factory

class lwsdk.ChannelFactory(name, klass)

Bases: lwsdk.lwsdk.IChannelFactory

Default Python Factory for IChannel

 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 noisy_channel(lwsdk.IChannel):
    def __init__(self, context):
        super(noisy_channel, self).__init__()

        self._channelid = context
[...]
    # LWChannel -------------------------------------------
    def flags(self):
        return 0

    def evaluate(self, ca):
        t = ca.time * self._speed

        V = lwsdk.Vector()
        V.x = 10 * t
        V.y = self._phase
        V.z = 20
[...]
ServerRecord = { lwsdk.ChannelFactory("LW_PyNoisyChannel", noisy_channel) : ServerTagInfo }

Table Of Contents

Previous topic

Node Class (Shader)

Next topic

Item Motion Class

This Page