maya playblast command not working right in maya 2024

maya playblast command not working right in maya 2024

Craig_Lamorte
Advocate Advocate
1,391 Views
2 Replies
Message 1 of 3

maya playblast command not working right in maya 2024

Craig_Lamorte
Advocate
Advocate

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.
0 Likes
Accepted solutions (1)
1,392 Views
2 Replies
Replies (2)
Message 2 of 3

Craig_Lamorte
Advocate
Advocate

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)

 

0 Likes
Message 3 of 3

Craig_Lamorte
Advocate
Advocate
Accepted solution

Apparently playblast will error out when the camera is in a group

0 Likes