I'm working on writing some scene info onto sequence preview jpgs and made a
python script to check the current frame against an editing info database when
I encountered this annoying oddity.
My basic testcase is now:
Constant->ModifyMetadata->Text->Write
-Constant is just a black background
-ModifyMetadata creates a new key exr/frame4text with [python nuke.frame()] and
I get the same result if I use nuke.root()['frame'].value()
-Text then writes the frame number onto the background with [python
nuke.thisNode().metadata('exr/frame4text')]
-Write, well writes the frame but I put a print
nuke.thisNode().metadata('exr/frame4text') into the "before each frame" to get
some feedback on the metadata state
Now, if you render this, for example from 1001-1005 (doesn't matter if locally
or on a client), you get the correct output into your Script Editor of
1001,1002,1003,1004,1005 but the text on the rendered frames shows the metadata
state from the frame before. For example, I'm at frame 1058 when I start the
render, so the text on the rendered pictures goes 1058,1001,1002,1003,1004. In
the Viewer everything is fine too, it only goes wrong once you actually render
it.
I'd expect Nuke to go frame+=1 and then ModifyMetadata->Text->Write but it
seems to go Write(wait)->Text->ModifyMetadata->Write(print and render)
This is also evident since the metadata key 'exr/frame4text' written to the exr
is correct, just the written Text is not.
Some things I tried that didn't work:
Constant->ModifyMetadata1->Text->ModifyMetadata1->Write
Constant->ModifyMetadata->Text1->Text1->Write
Constant->ModifyMetadata->Text1->Write1->Write1 (this can actually introduce
two frames "lag")
The only way I got correct data written was:
Constant->ModifyMetadata->Text1->Write1->Text2->Write2
The picture rendered in Write2 even shows the correct frame number written from
both Text tools, only in Write1 Text1 is wrong.
I hope I could make this clear, scratching my head on this one for a day now
and would like to know if there is anything actually wrong with Nuke here or if
I'm just too blind to see some logical error.
------------------------
http://www.imdb.com/name/nm2421901/
_______________________________________________
Nuke-python mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python