gsee

AM_shotCrvShow py2.7

Feb 20th, 2020
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.66 KB | None | 0 0
  1. #Show/hide crv from your camera shot view
  2.  
  3. #by Antoine Mallaroni, [email protected]
  4.  
  5. import maya.cmds as mc
  6.  
  7. camera = mc.shot(mc.sequenceManager(currentShot=True, query=True), currentCamera=True, query=True)
  8. panelCam = []
  9.  
  10. for n in mc.getPanel(type="modelPanel"):
  11.     if mc.modelPanel(n, query=True, camera=True) == camera:
  12.         panelCam.append(n)
  13.  
  14. if panelCam:      
  15.     for p in panelCam:
  16.         if mc.modelEditor(p, nc=True, q=True) == True:
  17.             mc.modelEditor(p, e=True, nc=False, ns=False)
  18.  
  19.         else:
  20.             mc.modelEditor(p, e=True, nc=True, ns=True)
  21.            
  22. else:
  23.     mc.warning('No shot or camera on shot')
Advertisement
Add Comment
Please, Sign In to add comment