Cmds.playblast Freezes Maya


I’m working on a tool that creates a playblast of the scene. I’ve done that using cmds.playblast. While it works fine with some scenes, it freezes maya with others. I’ve tried doing the playblast with the same properties using the normal playblast option window maya provides, and it works, but running the cmds.playblast commands with the same option and frames makes maya freeze and become non-responsive.

This is what is reflected in the script editor while running the playblast from the built in maya tool for it:

playblast -format avi -filename "movies/playblast.avi" -sequenceTime 0 -clearCache 1 -viewer 1 -showOrnaments 1 -fp 4 -percent 100 -compression "MS-CRAM" -quality 100;

while this is what I use:
cmds.playblast(format='avi', filename='movies/playblast.avi', sequenceTime =0, clearCache=1, viewer=1, showOrnaments=1, fp=4, percent=100, compression='MS-CRAM', quality=100)

I fear I’m not at the liberty to share the file so that issues can be reproduced by readers, what I can share is that this file references many other scene file that other people are working on simultaneously. Could that be an issue? If so, why is it not an issue while doing the built in playblast provided by Maya?


I have found out that while this error occurs in Viewport 2.0, it’s not an issue with Legacy Default Viewport (In Maya 2018). Why would that be? What settings can be tweaked with in Viewport 2.0 so that playblast command will work with the same.

Also, before figuring this out I also took the route of mel.eval and pymel.core with similar outcomes.