Eyeon:Script/Reference/Applications/Fuse/Classes/Input/GetSource

From VFXPedia

Jump to: navigation, search

Contents


Summary

The GetSource function is used to return the value of an Input at a time different from the current time. For example, GetSource could be used to produce images from the frames before and after the current frame, or to average the values of a Blur slider across 10 frames.


Usage

Input:GetSource(number frame)

frame (number, required)
A numeric value representing which frame will be read to produce the value.

Example

A trivial GetSource example, can be used to offset the current frame by a set number of frames.

FuRegisterClass("GetSourceExample", CT_Tool, {
	REGS_Category = "Fuses",
	REGS_OpIconString = "Gsr",
	REGS_OpDescription = "GetSource Example",
	REG_OpNoMask = true,
	REG_NoBlendCtrls = true,
	REG_NoObjMatCtrls = true,
	REG_NoMotionBlurCtrls = true,
	})
 
function Create()
 
	InOffset = self:AddInput("Offset", "Offset", {
		LINKID_DataType = "Number",
		INPID_InputControl = "SliderControl",
		INP_MinScale = 10.0,
		INP_MaxScale = -10.0,
		INP_Default = 0,
		})
 
	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)
	offset = InOffset:GetValue(req).Value
		
	local img = InImage:GetSource(req.Time + offset)
	
	OutImage:Set(req, img)
end


Tips for GetSource (edit)

EyeonTips:Script/Reference/Applications/Fuse/Classes/Input/GetSource