Eyeon:Script/Reference/Applications/Fuse/Tool/Events/NotifyChanged

From VFXPedia

Jump to: navigation, search

Fuse Reference Manual > NotifyChanged

Event Function


Contents


Summary

The NotifyChanged event function is executed any time a control is changed on a tool. It executes before the Process event function. Typically the NotifyChanged event is used to adjust the values of controls before they are locked for rendering.

For example, the NotifyChanged function may check to see if a Blur tools Lock X/Y Strength checkbox has been selected. If it has, it could take care of hiding or disabling the Y strength slider, and setting the Y strength to match the X strength.

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

See also Fuse Examples

See Also