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 Rhino, the plugin will reload the scene into Octane from Rhino, overwriting your changes.

To install the Python wrapper:

When you next re-install the OctaneRender for Rhino plugin, you will need to update this path to match the next install path used by Rhino.

Refer to C:\Program Files\Common Files\McNeel\Rhinoceros\6.0\Plug-ins\OctaneRenderForRhino ([plugin id])\ for a complete list of the functions available.

Following demonstrates how to use some of these functions.

import octane
import ctypes
from ctypes import c_uint

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

  # Resume rendering - if paused

  # Restart rendering

  # 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"

  rs = octane.ResultStatistics()
  print "Max Samples per Pixel = " + str(rs.maxSamplesPerPixel)

  usage = c_uint()
  total = c_uint()
  triCount = c_uint()
  meshCount = c_uint()        
  free = c_uint()
  hairCount = c_uint()        
  dispCount = c_uint()        
  octane.GetMemoryUsage(usage, free, total, triCount, meshCount, hairCount, dispCount)
  print "Used memory = " + str(usage.value)
  print "OctaneRender not loaded"