Not working. Looks like nuke is not even rendering at all until it
reach the last frame.

Looks like a bug?

On Wed, Aug 15, 2012, at 12:56, John RA Benson wrote:

if that's the case, try this:
    nuke.tprint('Rendering: path.%04d.jpg' % f)
    w['file'].setValue("path.%04d.jpg" % f)
in other words, force the write node to render the frame you are
getting.
jrab
On 08/15/2012 06:16 PM, Hugo Léveillé wrote:

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é [1]<[email protected]>
To: Nuke Python discussion [2]<[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
> >  [3][email protected]
> >
> > _______________________________________________
> > Nuke-python mailing list
> > [4][email protected],
[5]http://forums.thefoundry.co.uk/
> >
[6]http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
> >
> > _______________________________________________
> > Nuke-python mailing list
> > [7][email protected],
[8]http://forums.thefoundry.co.uk/
> >
[9]http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
>
>
> --
>  Hugo Léveillé
>  TD Compositing, Vision Globale
>  [10][email protected]
>
> _______________________________________________
> Nuke-python mailing list
> [11][email protected],
[12]http://forums.thefoundry.co.uk/
>
[13]http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-pytho
n
>
> _______________________________________________
> Nuke-python mailing list
> [14][email protected],
[15]http://forums.thefoundry.co.uk/
>
[16]http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-pytho
n
--
  Hugo Léveillé
  TD Compositing, Vision Globale
  [17][email protected]
_______________________________________________
Nuke-python mailing list
[18][email protected],
[19]http://forums.thefoundry.co.uk/
[20]http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-pytho
n

_______________________________________________

Nuke-python mailing list

[21][email protected],
[22]http://forums.thefoundry.co.uk/

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


--

Hugo Léveillé

TD Compositing, Vision Globale

[24][email protected]



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

References

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