View Full Version : problem with glRender flipbookCallback in PyMel

10-14-2010, 02:43 PM
I've been trying all day now trying to get this to work.
We've been doing this in MEL for quite some years now, but i can not get it work in PyMel or Python for Maya.

Basically this snippet of code has 2 functions, one is the flipBookCallBack and the other is a function that creates a window for the Hardware renderer.

def hos_db_gl_end(*args):
print('do some stuff, like moving image to proper location, renaming, etc')
print('close the window using pm.evalDeferred()')

def hos_db_gl_render():
pm.window( 'glWin', w=400, h=400)
pm.frameLayout( 'glRenderFrameCR', m=1, lv=0, bv=0, w=64, h=64 )
pm.glRenderEditor( 'hos_hwGLR', lt='persp' )
pm.showWindow( 'glWin' )
pm.SCENE.defaultHardwareRenderGlobals.startFrame.set( 0 )
pm.SCENE.defaultHardwareRenderGlobals.endFrame.set( 0 )
pm.SCENE.defaultHardwareRenderGlobals.filename.set( 'iconTmp' )
pm.SCENE.defaultHardwareRenderGlobals.resolution.set( '64x64 64 64 1.0' )
pm.SCENE.defaultHardwareRenderGlobals.extension.set( 1 )
pm.SCENE.defaultHardwareRenderGlobals.texturing.set( 1 )
pm.SCENE.defaultHardwareRenderGlobals.imageFormat.set( 8 )
pm.glRender( e=1, fc='hos_db_gl_end()' )
pm.glRender( e=1, ti=0, abp=2, vp=[ 64, 64, 1.0 ], imageSize=[ 64, 64, 1.0 ], es=1, os=1, aam='off', rs='hos_hwGLR' )

for some reason i always get the
// Error: hos_db_gl_end() "iconTmp" 0 0 1 25 "Z:/Projects/bol/maya_project/images/" "iconTmp.@.jpg"; // // Error: Line 1.25: Syntax error //
error message

now, usually using lambda *args: or Callback works, but it seems like the glRender flipbookCallback command calls functions in a way i'm not familiar with.

Has anyone figured this out or sees where i'm screwing up?

CGTalk Moderation
10-14-2010, 02:43 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.