Eyeon:Script/Reference/Applications/Fuse/ViewShader/Events/NotifyChanged
From VFXPedia
ViewShader Reference Manual > NotifyChanged
Event Function
Contents |
Summary
Similar to ScriptOperator's NotifyChanged(), the NotifyChanged event function is executed any time a control is changed in a ViewShader. The new Parameters from the Input associated with the control is passed as an argument, along with the Input itself. Typically the NotifyChanged event is used to adjust the parameters of related controls, or for performing precalculations and setup that does not need to be done every refresh.
For example, the NotifyChanged function could be used to get the text from a filename control, and to pre-load and store an image from that path.
Usage
NotifyChanged(object input, object parameter, number time)
Arguments
input (Input object)
- The Input object whose control has changed
parameter (Parameter object)
- The new Parameter object produced by the control (may be nil, datatype depends on the Input)
time (number)
- The current frame number, as shown on the comp's timeline.
Examples
function NotifyChanged(inp, param, time) if param and inp == InFilename then local filename = tostring(param.Value); -- get filename as a string local clip = Clip(filename); -- make a Clip out of it for loading local img = clip:GetFrame(0); -- just get the first frame if img then OverlayImage = img; -- keep this around for later else OverlayImage = nil; end end end