Skip to content

Instantly share code, notes, and snippets.

@robomojo
Created October 7, 2013 05:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robomojo/6863082 to your computer and use it in GitHub Desktop.
Save robomojo/6863082 to your computer and use it in GitHub Desktop.
maya quickrender
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