-- Transform an Alembic Camera into a Panoramic Camera Node -- -- @description get the current camera position and target for creating a new Panorama Camera Node -- @author Beppe Gullotta aka beppeg4d -- @version 0.2 -- @shortcut alt+p -- get the current render target and camera local rendertarget = octane.render.getRenderTargetNode() local camera = rendertarget:getInputNode(octane.P_CAMERA) -- get the position and target from the camera local poscam = camera:getPinValue(octane.P_POSITION) local target = camera:getPinValue(octane.P_TARGET) print ("camera position = ") print (unpack(poscam)) print ("target position = ") print (unpack(target)) -- get the current selection local selection = octane.project.getSelection() -- only do something if we do not have a single selection if #selection == 0 or selection[1].type ~= octane.NT_RENDERTARGET then error("a RenderTarget node needs to be selected") end local RTnode = selection[1] -- get the position of the selected node in the graph editor pos = RTnode.position print ("RT node position =") print (unpack(pos)) -- create a new Panoramic camera node local panoCam = octane.node.create { type =octane.NT_CAM_PANORAMIC, name = "Pano", position ={pos[1]-80, pos[2]-50}, graphOwner = root } RTnode:connectTo(octane.P_CAMERA, panoCam) panoCam:setPinValue(octane.P_POSITION, poscam) panoCam:setPinValue(octane.P_TARGET, target) panoCam:setPinValue(octane.P_KEEP_UPRIGHT, true) panoCam:setPinValue(octane.P_STEREO_OUTPUT, 3) print ("Happy VR rendering")