OXa^octane_versionf3040300?‡‰-- Take an ABC camera as input and extract its transformation -- the output tranform can be plugged in a placement node for example. local CamTransform = {} -- edit this to change the name of the graph local graphName = "cameraTransform" local inputs = {} local outputs = {} local transform = nil function CamTransform.onInit(self, graph) -- camera input pin local inputInfos = { { type = octane.PT_CAMERA, label = "Camera In", defaultNodeType = octane.NT_CAM_THINLENS }, } -- transform output pin local outputInfos = { { type = octane.PT_TRANSFORM, label = "Transform Out" }, } -- register the pins inputs = graph:setInputLinkers(inputInfos) outputs = graph:setOutputLinkers(outputInfos) -- create the transform_value node transform = octane.node.create{ type = octane.NT_TRANSFORM_VALUE, name = "Transform Value" } outputs[1]:connectToIx(1, transform) self:setEvaluateTimeChanges(true) graph.name = graphName graph:unfold() end -- extract camera matrix function convertInputs() local cameraNode = inputs[1]:getInputNodeIx(1) if cameraNode ~= nil then local pos = cameraNode:getPinValue(octane.P_POSITION) local target = cameraNode:getPinValue(octane.P_TARGET) local up = octane.vec.normalized(cameraNode:getPinValue(octane.P_UP)) local Z = octane.vec.normalized(octane.vec.sub(target, pos)) local X = octane.vec.normalized(octane.vec.cross(up, Z)) local Y = octane.vec.normalized(octane.vec.cross(Z, X)) matrix = { {X[1], Y[1], Z[1], pos[1]}, {X[2], Y[2], Z[2], pos[2]}, {X[3], Y[3], Z[3], pos[3]}, } transform:setAttribute(octane.A_TRANSFORM, matrix) end end function CamTransform.onEvaluate(self, graph) convertInputs() end return CamTransform ?‚Ì 0 0 0 assets\cameraTransform.lua yyfile;CŠUMnt: qq3S‡‰3‡ŒS‚Ìii#3‡‰>assets/cameraTransform.lua#3‚Ì> project.ocs^ZŸyyfile;CŠUMnt: qq3S‡‰3‡ŒS‚Ìii#3‡‰>assets/cameraTransform.lua#3‚Ì> project.ocs^ZŸ