[Maya2012] Playblast screenshot problem

Hey guys,

i have this method to produce a screenshot for a pose Library tool. In Maya 2013 it works flawless and produces an image in the specified directory,
in Maya 2012 it doesnt produce a screenshot at all (probably in the temp folder, but not in the path specified).
I dont think its a PyMel issue, the MEL and maya.cmds calls dont give the expected result in 2012 as well.

Any ideas anybody?

Here is the function:

#takeScreenshotForPoseBtn
def takeScreenshotForPoseBtn(filepath, filename, filesizeW, filesizeH):

defaultRenderGlobalsNode = pm.PyNode(‘defaultRenderGlobals’)

#Get Current imageFormat from renderglobals
currentImageFormat = pm.getAttr(defaultRenderGlobalsNode.name()+‘.imageFormat’)

#Set new imageFormat to jpg
defaultRenderGlobalsNode.setAttr(‘imageFormat’, 8)

#Create Playblast image

#create playblast image path
playblastImagePath = filepath +filename + ‘.jpg’
pm.playblast(cf = playblastImagePath, fr = [pm.currentTime()],wh = (filesizeW, filesizeH), fmt = ‘image’,o = False, orn = False, v = False, p = 100)

#Reset imageFormat to old one
defaultRenderGlobalsNode.setAttr(‘imageFormat’, currentImageFormat)

…sry, i dont seem to find the code tag right now…

Ok, problem fixed with the Api. For anybody else experiencing this problem, check these two links:

http://nathanhorne.com/?p=261

http://sergiosykes.wordpress.com/2012/02/04/playblast-completefilename-flag-in-2012/

Thanks Nathan :smiley:

The playblast command (MEL/maya.cmds) returns the path to the image that is created. If you did want to use playblast, you could just do some file manipulation after the fact.

Its because in 2012 the playblast cf flag for specifying the path was broken