Display 3D Class (2015)

Display 3D interface is used to create a window or screen to display color / anaglyph / 3D images. It allows the ability for users to write plugins to show the current view on a 3D monitor or head set.

The lwrender has the center, left and right camera eyes defined.

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.IDisplay3D(self)

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

Proxy of C++ PCore::IDisplay3D class

 getImage(int renderEye, LWPixmapID image) → int

This is where the image filter does its work. For each frame, the filter is given access to the red, green, blue and alpha channels of the rendered image, along with any other image buffers requested by the flags function. The access structure, described below, provides image information and functions for examining the buffers and writing new RGB and alpha values.

 setImage(int renderEye, LWPixmapID image) → int

This is where the image filter does its work. For each frame, the filter is given access to the red, green, blue and alpha channels of the rendered image, along with any other image buffers requested by the flags function. The access structure, described below, provides image information and functions for examining the buffers and writing new RGB and alpha values.

 showImage(int mode) → int

This is where the image filter does its work. For each frame, the filter is given access to the red, green, blue and alpha channels of the rendered image, along with any other image buffers requested by the flags function. The access structure, described below, provides image information and functions for examining the buffers and writing new RGB and alpha values.

viewPort(self) → int

Factory

class lwsdk.Display3DFactory(name, klass)

Bases: lwsdk.lwsdk.IDisplay3DFactory

Default Python Factory for IDisplay3D

create(context)
destroy(instance)
name()

Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
class black_and_white(lwsdk.IImageFilter):
    def __init__(self, context):
        super(black_and_white, self).__init__()

        self._context_flags = context

        self._gamma = 0.0  # this would be modified by a GUI
[...]
    # LWImageFilter ---------------------------------------
    def process(self, fa):
        mon = fa.monitor
        mon.init(mon.data, fa.height / 8)

        for row in range(fa.height):
            r = fa.getLine(lwsdk.LWBUF_RED, row)
            g = fa.getLine(lwsdk.LWBUF_GREEN, row)
            b = fa.getLine(lwsdk.LWBUF_BLUE, row)
            a = fa.getLine(lwsdk.LWBUF_ALPHA, row)
[...]
ServerRecord = { lwsdk.ImageFilterFactory("LW_PyBlackAndWhite", black_and_white) : ServerTagInfo }

Table Of Contents

Previous topic

Image Filter Class

Next topic

Global Classes

This Page