< Previous | Contents | Next >
UI Controls - Create Function
This is where parameter controls are defined, there are different types like sliders and onscreen crosshairs. The create function is run when the Fuse tool is added to the composition, or a composition containing that fuse tool is loaded. It describes the controls presented by the tools control window, and the inputs and outputs shown on the tools tile in the flow. The Create function takes no arguments.
It presents 3 sliders named ‘Brightness’, ‘Contrast’, ‘Saturation’ in the Inspector Tool control area , and the tool has one image input and one image output.
InBright = self:AddInput("Brightness","Brightness", { -- UI Label, Internal Ref
LINKID_DataType = "Number", INPID_InputControl = "SliderControl", INP_MaxScale = 1.0,
INP_MinScale = -1.0,
INP_Default = 0.0,
})
InContrast = self:AddInput("Contrast", "Contrast", { LINKID_DataType = "Number", INPID_InputControl = "SliderControl", INP_MaxScale = 1.0,
INP_MinScale = -1.0,
INP_Default = 0.0,
})
InSaturation = self:AddInput("Saturation", "Saturation", { LINKID_DataType = "Number",
INPID_InputControl = "SliderControl", INP_MaxScale = 5.0,
INP_MinScale = 0.0,
INP_Default = 1.0,
ICD_Center = 1,
})
InImage = self:AddInput("Input", "Input", { LINKID_DataType = "Image", LINK_Main = 1,
})
OutImage = self:AddOutput("Output", "Output", { LINKID_DataType = "Image",
LINK_Main = 1,
})
end -- end of Create()