local AnimateValueScript = {} local mOrigin local mStation1 local mStation2 local mStation3 local mStation4 local mStation5 local mStation6 local mStation7 local mStation8 local mStation9 local mStop local mSec local mOutput function AnimateValueScript.onInit(self, graph) graph:updateProperties({name = "AnimateValue Float Stations"}) -- create input linkers local inputs = graph:setInputLinkers { { type = octane.PT_FLOAT, label = "Origin Value", defaultNodeType = octane.NT_FLOAT, defaultValue = {0, 0, 0}, }, { type = octane.PT_FLOAT, label = "Station 1 value", defaultNodeType = octane.NT_FLOAT, defaultValue = {0, 0, 0}, }, { type = octane.PT_FLOAT, label = "Station 2 Value", defaultNodeType = octane.NT_FLOAT, defaultValue = {0, 0, 0}, }, { type = octane.PT_FLOAT, label = "Station 3 value", defaultNodeType = octane.NT_FLOAT, defaultValue = {0, 0, 0}, }, { type = octane.PT_FLOAT, label = "Station 4 Value", defaultNodeType = octane.NT_FLOAT, defaultValue = {0, 0, 0}, }, { type = octane.PT_FLOAT, label = "Station 5 value", defaultNodeType = octane.NT_FLOAT, defaultValue = {0, 0, 0}, }, { type = octane.PT_FLOAT, label = "Station 6 Value", defaultNodeType = octane.NT_FLOAT, defaultValue = {0, 0, 0}, }, { type = octane.PT_FLOAT, label = "Station 7 value", defaultNodeType = octane.NT_FLOAT, defaultValue = {0, 0, 0}, }, { type = octane.PT_FLOAT, label = "Station 8 Value", defaultNodeType = octane.NT_FLOAT, defaultValue = {0, 0, 0}, }, { type = octane.PT_FLOAT, label = "Station 9 value", defaultNodeType = octane.NT_FLOAT, defaultValue = {0, 0, 0}, }, { type = octane.PT_FLOAT, label = "End value", defaultNodeType = octane.NT_FLOAT, defaultValue = {0, 0, 0}, }, { type = octane.PT_FLOAT, label = "Per-Station Trip Time (sec)", defaultNodeType = octane.NT_FLOAT, defaultValue = 1, } } mOrigin = inputs[1] mStation1 = inputs[2] mStation2 = inputs[3] mStation3 = inputs[4] mStation4 = inputs[5] mStation5 = inputs[6] mStation6 = inputs[7] mStation7 = inputs[8] mStation8 = inputs[9] mStation9 = inputs[10] mStop = inputs[11] mSec = inputs[12] -- create output linker local outputs = graph:setOutputLinkers { { type = octane.PT_FLOAT, label = "Animated Value", defaultNodeType=octane.NT_OUT_FLOAT } } mOutput = outputs[1] end function AnimateValueScript.onEvaluate(self, graph) local startVal = mOrigin:getInputNode(octane.P_INPUT):getAttribute(octane.A_VALUE) local Station1Val = mStation1:getInputNode(octane.P_INPUT):getAttribute(octane.A_VALUE) local Station2Val = mStation2:getInputNode(octane.P_INPUT):getAttribute(octane.A_VALUE) local Station3Val = mStation3:getInputNode(octane.P_INPUT):getAttribute(octane.A_VALUE) local Station4Val = mStation4:getInputNode(octane.P_INPUT):getAttribute(octane.A_VALUE) local Station5Val = mStation5:getInputNode(octane.P_INPUT):getAttribute(octane.A_VALUE) local Station6Val = mStation6:getInputNode(octane.P_INPUT):getAttribute(octane.A_VALUE) local Station7Val = mStation7:getInputNode(octane.P_INPUT):getAttribute(octane.A_VALUE) local Station8Val = mStation8:getInputNode(octane.P_INPUT):getAttribute(octane.A_VALUE) local Station9Val = mStation9:getInputNode(octane.P_INPUT):getAttribute(octane.A_VALUE) local endVal = mStop:getInputNode(octane.P_INPUT):getAttribute(octane.A_VALUE) local totalT = mSec:getInputNode(octane.P_INPUT):getAttribute(octane.A_VALUE) local Output = octane.node.create { type = octane.NT_FLOAT, name = "Ani Value", graphOwner = graph } Output:setAnimator(octane.A_VALUE, { 0 }, { startVal, Station1Val, Station2Val, Station3Val, Station4Val, Station5Val, Station6Val, Station7Val, Station8Val, Station9Val, endVal}, totalT[1]) octane.changemanager.update() mOutput:connectTo(octane.P_INPUT, Output) AnimateValueScript:setEvaluateTimeChanges(true) end return AnimateValueScript