Skip to content

Commit

Permalink
Merge pull request #18 from cedricduriau/17-jsongetkeyinput
Browse files Browse the repository at this point in the history
implement show input control to allow input connection to key
  • Loading branch information
cedricduriau authored Mar 9, 2020
2 parents 3b78930 + 5c745cc commit 427185d
Showing 1 changed file with 34 additions and 1 deletion.
35 changes: 34 additions & 1 deletion fusion/Fuses/jsonget.fuse
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,18 @@ function Create()
InKey = self:AddInput("Key", "Key", {
LINKID_DataType = "Text",
INPID_InputControl = "TextEditControl",
TEC_Lines = 1
TEC_Lines = 1,
LINK_Main = 2
})

InShowInput = self:AddInput("Show Input", "ShowInput", {
LINKID_DataType = "Number",
INPID_InputControl = "CheckboxControl",
INP_Integer = true,
INP_Default = 0.0,
INP_External = false,
INP_DoNotifyChanged = true,
ICD_Width = 0.2
})

OutText = self:AddOutput("Output" , "Output" , {
Expand All @@ -42,6 +53,28 @@ function Create()
})
end

function NotifyChanged(inp, param, time)
--[[
Handles all input control events.

:param inp: Input that triggered a signal.
:type inp: Input

:param param: Parameter object holding the (new) value.
:type param: Parameter

:param time: Current frame number.
:type time: float
]]
if inp == InShowInput then
if param.Value == 1.0 then
InKey:SetAttrs({LINK_Visible = true})
else
InKey:SetAttrs({LINK_Visible = false})
end
end
end

function Process(req)
-- [[ Creates the output. ]]
local json_string = InJSON:GetValue(req).Value
Expand Down

0 comments on commit 427185d

Please sign in to comment.