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, lwsdk.lwsdk.IInterfaceFuncs, lwsdk.lwsdk.IGizmoFuncs, lwsdk.lwsdk.IItemFuncs, lwsdk.lwsdk.IRenderFuncs
Proxy of C++ PCore::IEnvironment class
This is where the environment handler does its work. At each time step in the animation, the evaluation function is called for each affected pixel in the image. The LWEnvironmentAccess
class instance provided (described below) contains information about the environment to be colored.
Returns flag bits combined using bitwise-or.
Bases: object
Proxy of C++ PCore::LWEnvironmentAccess class
In preview mode, this is where the evaluation function modifies the color at the corners of the rectangular area defined by LWEnvironmentAccess::h
and LWEnvironmentAccess::p
. The preview display interpolates between these at points inside the rectangle.
In real mode, this is where the evaluation function modifies the color of the point defined by the direction vector LWEnvironmentAccess::dir
.
A vector pointing toward a point on the backdrop to be colored. Use this when evaluating in real mode.
The heading extent of a rectangular area of the backdrop, expressed in radians. In preview mode, this, along with LWEnvironmentAccess::p
, form a bounding box in spherical coordinates of an area to be colored. They should be ignored in real mode.
The context of the evaluation. Currently this distinguishes between rendering (lwsdk.EHMODE_REAL
) and lower quality previewing (lwsdk.EHMODE_PREVIEW
).
The pitch extent of a rectangular area of the backdrop, expressed in radians. In preview mode, this, along with LWEnvironmentAccess::h
, form a bounding box in spherical coordinates of an area to be colored. They should be ignored in real mode.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | class horizon(lwsdk.IEnvironment):
def __init__(self, context, count):
super(horizon, self).__init__()
self._skySq = 2.0
self._gndSq = 2.0
[...]
# LWEnvironment ---------------------------------------
def flags(self):
return 0
def evaluate(self, ea):
dir = lwsdk.Vector(ea.dir)
color = lwsdk.Color(ea.color)
[...]
ServerRecord = { lwsdk.EnvironmentFactory("LW_PyHorizon", horizon) : ServerTagInfo }
|