Python Interface


The Python interface for the plugin is at the alpha testing stage, and included in the plugin installer from release You can modify anything in the Octane scene via python, however when you next update the scene in Nuke, the plugin will reload parts of the scene into Octane from Nuke, potentially overwriting your changes. Refer to C:\Program Files\Common Files\NUKE\[nuke version]\plugins\OctaneRender.bundle\ for a complete list of the functions available.

To load the Octane module

import os  
os.chdir("C:/Program Files/Common Files/NUKE/9.0/plugins/OctaneRender.bundle")  
import octane

# Examples of accessing Octane information
if octane.IsStarted():
  # Pause rendering

  # Restart rendering - if paused

  # Restart rendering - reload the scene

  # Get the rendertarget node
  rendertargetNode = octane.GetRenderTargetNode()

  if bool(rendertargetNode) != 0:
    # Get the number of pin on the rendertarget node
    numPins = octane.GetPinCount(rendertargetNode)
    print "Rendertarget pin count = " + str(numPins)

    print "No rendertarget found"
  print "No OctaneRender no loaded"