Setting the focus to the new script generated viewport
pm.setFocus(self.tempViewport)
Executing the playblast (Playblast command dosent let you name the viewport to Playblast from - it just takes the “active” view … which i assumed was the one with focus, apparently not! )
Any ideas on how to set the active view, via API or another method?
This code snippet seems to work for me. It appears that playblast() is intelligent enough to work on the active panel (not the model editor):
import maya.cmds as pm
print "Current panel to get playblasted is: " + pm.getPanel(withFocus=True)
tempPanel = pm.modelPanel(tearOff=True)
print "Tear off panel is: "+ tempPanel
print "Playblast currently focused on panel: "+ pm.playblast(activeEditor=True)
pm.setFocus(tempPanel)
print "Now playblast focused on panel: " +pm.playblast(activeEditor=True)
pm.evalDeferred("pm.playblast()")