Texture Editor Funcs (2015)

This global provides access to a user interface for editing textures. If you use XPanels with vparms that can be textured, the interaction with the texture editor is handled for you, and you don’t need this global. But if your interface is built with classic Panels or OS-specific elements, you can use this global to provide your users with the standard texture interface.

class lwsdk.LWTxtrEdFuncs(self)

Bases: object

Proxy of C++ PCore::LWTxtrEdFuncs class

 close(LWTECltID ctl_id)

Close the texture editor window.

 currentLayer(LWTECltID ctl_id) → LWTLayerID

Returns the texture layer currently being edited.

 isOpen(LWTECltID ctl_id) → int

True if the editor window is currently open.

 open(LWTECltID ctl_id, LWTextureID txtr_id, char title)

Open the texture editor window.

 refresh(LWTECltID ctl_id) → int

Redraw the editor window.

 selectAdd(LWTECltID ctl_id, LWTextureID txtr_id) → int

Add the texture txtr_id to a multi-selection.

 selectClr(LWTECltID ctl_id) → int

Clear the selection list.

 selectFirst(LWTECltID ctl_id) → LWTextureID

Enumerate the selected textures. Returns the first texture.

 selectNext(LWTECltID ctl_id, LWTextureID txtr_id) → LWTextureID

Enumerate the selected textures. Returns the texture that follows txtr_id.

 selectRem(LWTECltID ctl_id, LWTextureID txtr_id) → int

Remove the texture txtr_id from a multi-selection.

 setGradientAutoSize(PyObject self, LWTECltID id, PyObject gradautosize_callback)

Set a callback for autosize requests from gradient texture layers.

NOTE: For reasons of internal mapping, the self argument should be your class instance. This differs from the SDK function.

 setPosition(LWTECltID ctl_id, int x, int y)

Move the editor window. The coordinates are for the upper left corner of the window.

 setTexture(LWTECltID ctl_id, LWTextureID txtr_id, char title)

Initialize the texture editor with the texture to be edited.

 subscribe(char title, int flags, PyObject data, PyObject remove_callback, PyObject autosize_callback, PyObject event_callback) → LWTECltID

Returns an identifier that plug-ins use in later calls to the texture editor functions. The callbacks are optional (pass None if you do not wish to define one) and are called when the user removes or autosizes a texture, or does anything with it in the editor. The data argument is passed to these callbacks; for reasons of internal mapping, this needs to be your self instance.

The flags determine what the user can do in the editor and can be one or more of the following:

lwsdk.TEF_USEBTN
    Add use/remove buttons at the bottom of the pane.
lwsdk.TEF_OPACITY
    Add layer opacity settings.
lwsdk.TEF_BLEND
    Add blend options to the layer global settings.
lwsdk.TEF_TYPE
    Add layer type control on the top of the pane.
lwsdk.TEF_LAYERS
    Add layer list pane on the left side of the pane.
lwsdk.TEF_ALL
    All of the above flags. This is the standard configuration for the texture editor.

 unsubscribe(LWTECltID ctl_id)

Free resources allocated by LWTxtrEdFuncs.subscribe(). This call invalidates the client ID. You'll need to call LWTxtrEdFuncs.subscribe() again before calling the texture editor functions.

Previous topic

Plugin License (2015)

Next topic

Color Space Funcs (2015)

This Page