John,

This may be to simplistic, but didi you try making a condition for the execute 
to be something similar to nuke.frame() == firstFrame ?
Maybe use a try: statement with some number of tries or with a sleep time 
in-between…? Just thinking….

Rich



On Oct 25, 2013, at 1:41 PM, John Vanderbeck 
<[email protected]> wrote:

> Hey all,
> 
> Been going out of my mind the last few days and hoping one of you geniuses 
> might be able to help ease my pain.
> 
> Basically I need to script the use of O_Solver to set three keyframes.
> 
> I'm running into issues though because of the way Nuke handles threads.  If I 
> do something like this all in the main thread:
> 
> solverNode = nuke.toNode("O_Solver1")
> addKeyKnob = solverNode.knob("addAnalysisKey")
> print "Jumping to frame %d" % firstFrame
> nuke.frame(firstFrame)
> print "Setting Key"
> addKeyKnob.execute()
> 
> Then what happens is the key gets set, but NOT on the proper frame.  Nuke 
> doesn't seem to have finished setting the frame before the next call, so the 
> key ends up being set on whatever frame the playhead happened to be on.
> 
> So I then reworked things to do it all in a subthread.  This worked 
> perfectly, but then I had the problem of knowing when it was done.  If I 
> tried to block the main thread while waiting on the subthread, then Nuke 
> again wouldn't properly set the keyframes.  Unfortunately it is vital that I 
> be able to wait and not return until all keyframes are set :(
> 
> Any thoughts?
> 
> -- 
> - John Vanderbeck
> - Prime Focus World, Vancouver
> - 2D Pipeline TD
> 
> _______________________________________________
> 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

Reply via email to