if I add a print statement like : print nuke.frame() in the def, it
prints the frame just rendered and not the same frame over and over
again.

On Wed, Aug 15, 2012, at 11:30, Howard Jones wrote:

It renders the frame you are on as you specified that in render_jpeg
'f=nuke.frame()'

Howard
  __________________________________________________________________

From: Hugo Léveillé <[email protected]>
To: Nuke Python discussion <[email protected]>
Sent: Wednesday, 15 August 2012, 16:11
Subject: Re: [Nuke-python] afterFrameRender freezing....
thanks
Unfortunately, it's still not working as expected. Nuke is not hanging
anymore, but it only rendering the last frame of the requested range.
So
I render 1-10 in the main write, I should be triggering 10 afterFrame
callback, rendering the frame just rendered to jpeg. But it will only
render frame 10.
Any clue why?? Here's my script now. The only difference from yours is
that I create a temp rean so that the jpeg is rendered from the dpx and
not the whole flow.
import threading
def renderAWrite(node, start, end):
    nuke.executeInMainThread(nuke.execute, args=(node, start, end),
        kwargs={'continueOnError': True})
def render_jpg():
    f = nuke.frame()
    read = nuke.createNode("Read",inpanel=False)
    read['file'].setValue(nuke.thisNode()['file'].value())
    read['first'].setValue(f)
    read['last'].setValue(f)
    w = nuke.createNode('Write', inpanel=False)
    w['file'].setValue("path.%04d.jpg")
    w.setInput(0, read)
    t = threading.Thread(None, renderAWrite, args=(w, f, f))
    t.start()

On Tue, Aug 14, 2012, at 15:20, Nathan Rusch wrote:
> I think you may have the calling sequence and locations a little
switched
> around... You only use nuke.executeInMainThread from within the code
> that's
> running on the new thread.
>
>
> import threading
>
> def renderAWrite(node, start, end):
>    nuke.executeInMainThread(nuke.execute, args=(node, start, end),
> kwargs={'continueOnError': True})
>
> def afterRenderFunc():
>    f = nuke.frame()
>    w = nuke.createNode('Write', inpanel=False)
>    w['file'].setValue('/path.%04d.jpg')
>    w.setInput(0, nuke.thisNode().input(0))
>    t = threading.Thread(None, renderAWrite, args=(w, f, f))
>    t.start()
>
>
> Hope this helps.
>
> -Nathan
>
> -----Original Message-----
> From: Hugo Léveillé
> Sent: Tuesday, August 14, 2012 11:23 AM
> To: Nuke Python discussion
> Subject: Re: [Nuke-python] afterFrameRender freezing....
>
> 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
> >  [1][email protected]
> >
> > _______________________________________________
> > Nuke-python mailing list
> > [2][email protected],
[3]http://forums.thefoundry.co.uk/
> >
[4]http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
> >
> > _______________________________________________
> > Nuke-python mailing list
> > [5][email protected],
[6]http://forums.thefoundry.co.uk/
> >
[7]http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
>
>
> --
>  Hugo Léveillé
>  TD Compositing, Vision Globale
>  [8][email protected]
>
> _______________________________________________
> Nuke-python mailing list
> [9][email protected],
[10]http://forums.thefoundry.co.uk/
>
[11]http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-pytho
n
>
> _______________________________________________
> Nuke-python mailing list
> [12][email protected],
[13]http://forums.thefoundry.co.uk/
>
[14]http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-pytho
n
--
  Hugo Léveillé
  TD Compositing, Vision Globale
  [15][email protected]
_______________________________________________
Nuke-python mailing list
[16][email protected],
[17]http://forums.thefoundry.co.uk/
[18]http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-pytho
n

_______________________________________________

Nuke-python mailing list

[19][email protected],
[20]http://forums.thefoundry.co.uk/

[21]http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-pytho
n

References

1. mailto:[email protected]
2. mailto:[email protected]
3. http://forums.thefoundry.co.uk/
4. http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
5. mailto:[email protected]
6. http://forums.thefoundry.co.uk/
7. http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
8. mailto:[email protected]
9. mailto:[email protected]
  10. http://forums.thefoundry.co.uk/
  11. http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
  12. mailto:[email protected]
  13. http://forums.thefoundry.co.uk/
  14. http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
  15. mailto:[email protected]
  16. mailto:[email protected]
  17. http://forums.thefoundry.co.uk/
  18. http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
  19. mailto:[email protected]
  20. http://forums.thefoundry.co.uk/
  21. 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