-- ============================================================================
-- Blabber
-- ============================================================================
--[[
The authors hereby grant permission to use, copy, and distribute this
software and its documentation for any purpose, provided that existing
copyright notices are retained in all copies and that this notice is
included verbatim in any distributions. Additionally, the authors grant
permission to modify this software and its documentation for any
purpose, provided that such modifications are not distributed without
the explicit consent of the authors and that existing copyright notices
are retained in all copies.
IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY FOR
DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY DERIVATIVES
THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND
DISTRIBUTORS HAVE NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT,
UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
--]]
-- ============================================================================
-- Constants
-- ============================================================================
VERSION = "v0.1 (2019-0719) by Kristof Indeherberge"
FUSE_NAME = "Point_Offset"
-- ============================================================================
-- Float fuse
-- Fuse that creates a integer number
-- ============================================================================
FuRegisterClass( FUSE_NAME , CT_Tool , {
--REG_Fuse_NoEdit = true,
--REG_Fuse_NoReload = true,
--REG_Fuse_TilePic = fuse_pic,
--REG_NoBlendCtrls = true,
REG_NoCommonCtrls = true,
--REG_NoMotionBlurCtrls = true,
--REG_NoPreCalcProcess = true, -- call Process for precalc requests (instead of PreCalcProcess)
--REG_OpNoMask = true,
--REG_SupportsDoD = true, -- this tool supports DoD
--REG_TimeVariant = true,
--REG_Unpredictable = true, -- this tool shall never be cached
--REG_Version = 100,
REGS_Category = "xmnr0x23\\Math",
--REGS_Company = "UNT",
--REGS_HelpTopic = "http://en.wikipedia.org/wiki/Acme_Corporation",
REGS_Name = FUSE_NAME,
REGS_OpDescription = "Create a point",
REGS_OpIconString = FUSE_NAME,
--REGS_URL = "http://en.wikipedia.org/wiki/Acme_Corporation",
} )
function Create()
InPoint = self:AddInput( "Position" , "Position" , {
LINKID_DataType = "Point",
--INPID_InputControl = "OffsetControl",
--INPID_PreviewControl = "PointControl",
--INP_Default = 1.0,
--INP_Integer = true,
--ICS_Name = "Position Locator",
LINK_Main = 1,
} )
InXOffset = self:AddInput( "X Offset" , "XOffset" , {
LINKID_DataType = "Number",
LINK_Main = 2,
INP_Required = true,
})
InYOffset = self:AddInput( "Y Offset" , "YOffset" , {
LINKID_DataType = "Number",
LINK_Main = 3,
INP_Required = false,
})
OutN = self:AddOutput( "Output" , "Output" , {
LINKID_DataType = "Point",
LINK_Main = 1,
} )
--[[
InLabel = self:AddInput( VERSION , "version" , {
LINKID_DataType = "Text",
INPID_InputControl = "LabelControl",
INP_External = false,
INP_Passive = true,
} )
--]]
end
function Process( req )
local point = InPoint:GetSource( req.Time )
local x_offset = InXOffset:GetValue( req ).Value
local y_offset = InYOffset:GetValue( req ).Value
--print ( point )
point.X = point.X + x_offset
point.Y = point.Y + y_offset
out = point
OutN:Set( req , out )
end