The script connects the Maya Smooth Mesh Preview to Octane Opensubdiv level for all meshes found in the selected objects/hierarchy.
Once the script is applied to a mesh, Octane will always respect these settings :
(meaning that if needed you can still have one subdiv level for the viewport and another for rendering )
when using the hotkeys 0, 1, 2, 3, page-up, page-down, remember that IPR only refresh the smoothing if the mesh is of the "reshapable" type.
and keep in mind that the Maya plugin also doesn't support the subdiv Crease.
As usual open or copy this script in a python tab in the script editor and execute, or drop it in a shelf as python button.
- Code: Select all
# This script create an expression for all meshes found in the selected objects/hierarchy.
# The expression connects Maya Smooth Mesh Preview attributes to Octane Opensubdiv level.
# "smooth mesh preview" and "use Preview level for rendering" are respected .
# v 0.1
import maya.cmds as cmd
meshes = cmd.listRelatives(cmd.ls(sl= True, visible=True) , path=True, type="mesh", allDescendents=True, ni=True)
if meshes:
for mesh in meshes:
connected = cmd.listConnections(mesh+".octSubdLevel", s=True, d=False)
if not connected:
cmd.expression(o=mesh, s="octSubdLevel = (displaySmoothMesh>0) * ((useSmoothPreviewForRender==0) ? renderSmoothLevel : smoothLevel );")
print (mesh+".octSubdLevel is connected")