MoonLiveModifier
Source:
MoonLiveModifier.h
MoonLiveModifier¶
src/light/moonlive/MoonLiveModifier.h:25Inherits:
ModifierBase
A coordinate transform authored live rather than compiled in.
Public Methods¶
virtual inline const char * tags() const override
: The tags the script declares, or the scripted-module mark when it declares none.
virtual inline Dim dimensions() const override
: The axes this modifier declares, which the card and the picker show.
virtual inline void defineControls() override
: Publish the script name, and every control the script declares.
virtual inline void prepare() override
: Compile the script as written.
virtual inline bool consumeNeedsRebuild() override
: The Layer polls this after ticking its modifiers and rebuilds its mapping once if any asks.
virtual inline void modifyLogicalSize(Coord3D & size) override
: Stash the running logical box, so the script can read width, height and depth.
virtual inline bool modifyLogical(Coord3D & pos) const override
: Transform one coordinate, called once per physical light while the mapping builds.
virtual inline void release() override
: Drop the compiled program and its memory.
inline void setScript(const char * name)
: Replace the script, which the next prepare compiles by the path a UI edit takes.
More info¶
This is the second binding of the engine, and what shows the engine is domain-neutral: it needed no engine, IR, grammar or backend change. An effect script writes a color per light and a modifier a position, and both are three values stored at an index.
Why the script does not loop¶
The Layer already does: modifyLogical is called once per physical light while the mapping builds, so a script transforms one coordinate.
A coordinate arriving outside the representable range passes through untransformed rather than wrapping to a wrong position. An out-of-range result is the script's own.