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" }, } -- create nodes that will provide the normal texture and the copy with new transform value OutputU1 = octane.node.create { type = octane.NT_OUT_TEXTURE, name = outputs[1].name, graphOwner = graph, pinOwnerNode = outputs[1], pinOwnerIx = 1 } OutputU2 = octane.node.create { type = octane.NT_OUT_TEXTURE, name = outputs[2].name, graphOwner = graph, pinOwnerNode = outputs[2], pinOwnerIx = 1 } OutputU1:connectTo(octane.P_INPUT, InputT) end function OffsetTexScript.onEvaluate(self, graph) local inTex = InputT:getConnectedNode(octane.P_INPUT) 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) OutputU2:connectTo(octane.P_INPUT, Tex2) end return OffsetTexScript