Created
October 7, 2013 05:49
-
-
Save robomojo/6863082 to your computer and use it in GitHub Desktop.
maya quickrender
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
import os | |
import pymel.core as pm | |
cameras = pm.ls(type=pm.nodetypes.Camera) | |
for each in cameras: | |
val = True if 'preview' in each.name() else False | |
if val: playblasting = True | |
pm.setAttr(each.renderable,val) | |
each.setFilmFit('verticalFilmFit') | |
name = pm.system.sceneName().replace('.','/').split('/')[-2] | |
dir = 'c:\\playblast\\'#+name+'\\' | |
path = dir+name+'.avi' | |
if not os.path.exists(dir): | |
os.makedirs(dir) | |
if playblasting: pm.animation.playblast(widthHeight = (1136,640), percent=100, format='movie', filename=path) | |
else: raise Exception ('Fail: no camera with \'preview\' in name') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment