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

From VFXPedia

Jump to: navigation, search

Contents


OffsetControl Control

Description

The OffsetControl is generally used to represent a 2D co-ordinate, and presents separate edit boxes for the X and Y co-ordinates. It is frequently associated with a the Crosshair preview control.

To add an OffsetControl, set the INPID_InputControl attribute of the AddInput function to the string "OffsetControl".

OffsetControl returns the Point datatype.


Attributes

OFCD_DisplayXScale numeric : The value displayed in the offset control for the X axis will be multiplied by the number provided here.
OFCD_DisplayYScale numeric : The value displayed in the offset control for the X axis will be multiplied by the number provided here. See the effect of the Merge and Transform tools reference inputs on the Size input for an example of the effect of these attributes.
INP_DefaultX numeric : The default value to use for the X co-ordinate.
INP_DefaultY numeric : The default value to use for the X co-ordinate.

.


Example

For a more extensive example, see the FuseTransform.Fuse example at Example Fuses.

The following example is a very simplified Fuse which uses a crosshair to transform an image.

FuRegisterClass("SampleOffset", CT_Tool, {
	REGS_Category = "Fuses\\Samples",
	REGS_OpIconString = "SOf",
	REGS_OpDescription = "SampleOffset",
	})
 
function Create()
	InCenter = self:AddInput("Center", "Center", {
		LINKID_DataType = "Point",
		INPID_InputControl = "OffsetControl",
		INPID_PreviewControl = "CrosshairControl",
		})
 
	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)
	
	out = img:Transform(nil, { 
		XF_XOffset = center.X, 
		XF_YOffset = center.Y, 
		XF_XAxis = 0.5,
		XF_YAxis = 0.5,
		XF_XSize = 1, 
		XF_YSize = 1, 
		XF_Angle = 0, 
		XF_EdgeMode = "Black",
		})
	
	OutImage:Set(req, out)
end


Tips for OffsetControl (edit)

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