yeah but running nuke.execute ends in a "already executing something
else" ?

import threading
def renderMe(node,inP,outP):
    nuke.execute( node , inP , outP )

def render_jpg():
    frame = nuke.frame()
    w = nuke.createNode("Write")
    w['file'].setValue("/path.####.jpg")
    thread = threading.Thread( None , renderMe , args = ( w , frame , 
    frame )  )
    nuke.executeInMainThread( thread.start  )






On Tue, Aug 14, 2012, at 13:43, Nathan Rusch wrote:
> You can't call nuke.executeInMainThread from the main thread or Nuke will 
> lock up.
> 
> -Nathan
> 
> 
> -----Original Message----- 
> From: Hugo Léveillé
> Sent: Tuesday, August 14, 2012 10:39 AM
> To: PYTHON (nuke) discussion
> Subject: [Nuke-python] afterFrameRender freezing....
> 
> I know there has been few discussions about this, but it's still failing
> on me. Basically I just want to render a simple jpg of the frame just
> rendered.
> 
> the code:
> ----------------------------
> 
> import threading
> def renderMe(node,inP,outP):
>     nuke.executeInMainThreadWithResult( nuke.execute , args = ( node ,
>     inP , outP ) , kwargs = { 'continueOnError' : True } )
> 
> def render_jpg():
>     frame = nuke.frame()
>     w = nuke.createNode("Write")
>     w['file'].setValue("/path.####.jpg")
>     thread = threading.Thread( None , renderMe , args = ( w , frame ,
>     frame )  )
>     nuke.executeInMainThread( thread.start  )
> 
> 
> -------------------------------------
> 
> I call render_jpg()
> 
> Sometimes it works but more often than others the progress bar just
> freeze forever. Anyone knows what the problem might be ?
> 
> 
> -- 
>   Hugo Léveillé
>   TD Compositing, Vision Globale
>   [email protected]
> 
> _______________________________________________
> Nuke-python mailing list
> [email protected], http://forums.thefoundry.co.uk/
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python 
> 
> _______________________________________________
> Nuke-python mailing list
> [email protected], http://forums.thefoundry.co.uk/
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python


-- 
  Hugo Léveillé
  TD Compositing, Vision Globale
  [email protected]

_______________________________________________
Nuke-python mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python

Reply via email to