Tuesday, January 22, 2013

Maya playblasts on windows!

Maya 64bit Windows appears to be the only version without quicktime support, which to me means crappy codecs, and/or huge filesizes (and more than likely both)

To combat this, I made a little script to compress your playblasts with x264.

You're going to need to save the x264.exe to your C:/ root directory.
Download x264 here!

Then just run this script:


 # Runs the PB Script and saves the file  
 from pymel.core import *  
 from pymel.util.path import path  
 import os  
 import subprocess  
 filename = path(str(fileDialog2(ff='*.mp4')[0]))  
 nicename = filename.strip('.mp4')  
 try:  
      blast = playblast(fmt='avi', v=0, os=1, wh=[1080,720], p=100, filename=nicename, fo=1)  
 except:  
      print 'Playblast interrupted; continuing compression'  
 finally:  
      os.system('C:\\x264.exe -o {nn}.mp4 {nn}.avi'.format(nn=nicename))  
      os.remove('{nn}.avi'.format(nn=nicename))  
      player = subprocess.Popen(filename, shell=1)  


You can edit the playblast line to suit your needs, also. (resolution, etc)
Try everything out and let me know how it goes!

1 comment:

  1. Hey John!
    Make sure you're in the Python tab, if you're running it from mel, syntax is way different :)

    Also, I'm gonna try to make this code a little cleaner today, so check back in sometime soon!

    ReplyDelete