I FINALLY found some example fuses on VFXPedia. It took some diving into other VFX forms. I suspect if I post a link I'll get flagged as spam, but I can upload two or three of them as attachments.
Fake edit: Neither '.txt' nor 'fuse' are allowed as file types, so I have to just copy/paste them here:
===
- Code: Select all
--[[--
Null.Fuse
About as simple as it gets. This tool doesn't actually do anything - it just passes the input to the output. An example of the bare minimum required to create a tool.
version 1.0
August 21st, 2007
--]]--
FuRegisterClass("Null", CT_Tool, {
REGS_Category = "Fuses\\eyeon\\Examples",
REGS_OpIconString = "Nul",
REGS_OpDescription = "Null Fuse",
REG_OpNoMask = true,
REG_NoBlendCtrls = true,
REG_NoObjMatCtrls = true,
REG_NoMotionBlurCtrls = true,
})
function Create()
InBlank = self:AddInput(" ", "Blank", {
LINKID_DataType = "Number",
INPID_InputControl = "LabelControl",
INP_External = false,
})
InImage = self:AddInput("Input", "Input", {
LINKID_DataType = "Image",
LINK_Main = 1,
})
OutImage = self:AddOutput("Output", "Output", {
LINKID_DataType = "Image",
LINK_Main = 1,
})
end
function Process(req)
local img = InImage:GetValue(req)
img:Use()
OutImage:Set(req, img)
end
And CropRectangle because it's short enough to still fit:
- Code: Select all
--[[--
CropRectangle.Fuse
This Fuse is a variation on the crop tool. It initially presents an uncropped
version of the image, with an onscreen rectangle control that represents the
cropping region.
Selecting the "Show Crop" option will output the cropped image instead.
Written By : Isaac Guenard [izyk@eyeonline.com]
Written On : November 22nd, 2007
Version 1
--]]--
FuRegisterClass("CropRectangle", CT_Tool, {
REGS_Category = "Transform",
REGS_OpIconString = "CrpR",
REGS_OpDescription = "Crops to a rectangle control",
REG_NoAutoProxy = true,
REG_NoMotionBlurCtrls = true,
REG_NoObjMatCtrls = true,
REG_NoBlendCtrls = true,
REG_OpNoMask = true,
})
function Create()
InOperation = self:AddInput("Show", "Show", {
LINKID_DataType = "Number",
INPID_InputControl = "MultiButtonControl",
INP_Default = 0.0,
{ MBTNC_AddButton = "Uncropped", MBTNCD_ButtonWidth = 0.5, },
{ MBTNC_AddButton = "Show Crop", MBTNCD_ButtonWidth = 0.5, },
INP_DoNotifyChanged = true,
})
InCenter = self:AddInput("Center", "Center", {
LINKID_DataType = "Point",
INPID_InputControl = "OffsetControl",
INPID_PreviewControl = "CrosshairControl",
INP_DoNotifyChanged = true, -- We want to hear about changes on this control
})
InWidth = self:AddInput("Width", "Width", {
LINKID_DataType = "Number",
INPID_InputControl = "SliderControl",
INP_Default = 1.0,
INPID_PreviewControl = "RectangleControl",
PC_ControlGroup = 1,
PC_ControlID = 0,
})
InHeight = self:AddInput("Height", "Height", {
LINKID_DataType = "Number",
INPID_InputControl = "SliderControl",
INP_Default = 1.0,
INPID_PreviewControl = "RectangleControl",
PC_ControlGroup = 1,
PC_ControlID = 1,
})
InImage = self:AddInput("Input", "Input", {
LINKID_DataType = "Image",
LINK_Main = 1,
})
OutImage = self:AddOutput("Output", "Output", {
LINKID_DataType = "Image",
LINK_Main = 1,
})
end
function Process(req)
local img = InImage:GetValue(req)
local center = InCenter:GetValue(req)
local width = InWidth:GetValue(req).Value
local height = InHeight:GetValue(req).Value
local operation = InOperation:GetValue(req).Value
if operation == 0 then
-- we are looking at the original, and doing nothing
img:Use() -- increment the images Use count
OutImage:Set(req, img)
else
-- we are doing the actual crop
local out = Image({
IMG_Like = img,
IMG_Width = math.floor(img.Width * width + 0.5),
IMG_Height = math.floor(img.Height * height + 0.5),
IMAT_OriginalWidth = math.floor(img.OriginalWidth * width + 0.5),
IMAT_OriginalHeight = math.floor(img.OriginalHeight * height + 0.5),
IMAT
})
img:Crop(out, {
CROP_XOffset = math.floor(img.Width * center.X - (img.Width * width / 2) + 0.5),
CROP_YOffset = math.floor(img.Height * center.Y - (img.Height * height / 2) + 0.5),
})
OutImage:Set(req, out)
end
end
function NotifyChanged(inp, param, time)
if inp == InCenter then -- Center moved, update rectangle control position
InHeight:SetAttrs({ RCD_SetX = param.X, RCD_SetY = param.Y })
elseif inp == InOperation then
InHeight:SetAttrs({ PC_Visible = (param.Value < 1) })
InCenter:SetAttrs({ PC_Visible = (param.Value < 1) })
end
end