Last active
September 5, 2017 15:01
-
-
Save SEVEZ/103674f1c319f0ffc15c5ade30a7ac76 to your computer and use it in GitHub Desktop.
Fit near and far camera clipping planes by object's bounding box #misc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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