local OffsetTexScript = {} local InputT local InputU local OutputU1 local OutputU2 function OffsetTexScript.onInit(self, graph) graph:updateProperties({name = "OffsetTexture"}) -- create input linkers local inputs = graph:setInputLinkers { { type = octane.PT_TEXTURE, label = "Tex-in", fromNodeType = octane.NT_OUT_TEXTURE, fromPinId = octane.P_INPUT }, { type = octane.PT_TRANSFORM, label = "UV-in", fromNodeType = octane.NT_OUT_TRANSFORM, fromPinId = octane.P_INPUT } } InputT = inputs[1] InputU = inputs[2] -- create output linkers local outputs = graph:setOutputLinkers { { type = octane.PT_TEXTURE, label = "tex-out-1" }, { type = octane.PT_TEXTURE, label = "tex-out-2" }, } OutputU1 = outputs[1] OutputU2 = outputs[2] end function OffsetTexScript.onEvaluate(self, graph) local inTex = InputT:getConnectedNode(octane.P_INPUT) local Tex1 = octane.nodegraph.copyItemTree(graph, inTex) local Tex2 = octane.nodegraph.copyItemTree(graph, inTex) local inUV = InputU:getConnectedNode(octane.P_INPUT) local UV2 = octane.nodegraph.copyItemTree(graph, inUV) Tex2:connectTo(octane.P_TRANSFORM, UV2) OutputU1:connectTo(octane.P_INPUT, Tex1) OutputU2:connectTo(octane.P_INPUT, Tex2) end return OffsetTexScript