I have a script that creates a thumbnail for our scene. It uses playblast to create the screenshot, and it used to work in 2022 but having issues in 2024.
cmds.playblast(format="iff", filename=os.path.splitext(thumbPath)[0], st=1, et=1, clearCache=1, viewer=0, fo=True,
showOrnaments=False, fp=2, percent=100, compression=fileFormat, quality=100, widthHeight=[resolution, resolution])
the command works if i run it in the script editor in an open scene but if its run through our script (which we do move the camera to get the model in the picture) it will come up with this error
# Error: Unable to allocate offscreen buffer for playblast.
Solved! Go to Solution.
Solved by Craig_Lamorte. Go to Solution.
I have found the piece of code that is causing the playblast capture to error and not allocate offscreen buffer. its when the newly created camera is put into a group and positioned. Unsure why this code is causing this error, and it worked fine in maya 2022
cmds.select(thumbnail_cam[0])
newGrp = mel.eval('group;')
mel.eval('xform -os -piv 0 0 0;')
mel.eval('setAttr "%s.rotateX" -15;' % (newGrp))
cmds.refresh()
cmds.select(newGrp)
newGrp2 = mel.eval('group;')
mel.eval('xform -os -piv 0 0 0;')
mel.eval('setAttr "%s.rotateY" -38.5;' % (newGrp2))
pm.viewFit(thumbnail_cam, all=True)
Can't find what you're looking for? Ask the community or share your knowledge.