Skip to content

Instantly share code, notes, and snippets.

@SEVEZ
Last active September 5, 2017 15:03
Show Gist options
  • Save SEVEZ/6ce3908f11968ad5eac1 to your computer and use it in GitHub Desktop.
Save SEVEZ/6ce3908f11968ad5eac1 to your computer and use it in GitHub Desktop.
Set camera clipping planes for rendering z-depth #misc
from pymel.core import *
sel = selected()[0]
cam = PyNode( 'persp1' )
parent( sel, cam, a=1 )
bbcoord = xform( sel, q=1, os=1, bb=1 )
near = -bbcoord[5]
far = -bbcoord[2]
cam.setClippingPlanes( 1 )
cam.setFarClipPlane( far )
cam.setNearClipPlane( near )
parent( sel, w=1 )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment