Hello everyone,
I need to get a definitive answer from someone in the know about how to
best to go about sampling image data before engine() is called. I have
asked this a few times before but am yet to get an explicit answer and
would really like to know the official (and reliable!) way of doing
this. The problem is that we have several nodes that require an input
image to be sampled before engine is called in order to change the
layout of an internal node tree or set the bbox to a particular size etc.
Here is a summary of what I know already so please correct and add to
this if you know otherwise:
* It is bad practice to grab an input image from within validate() or
open(). This is for two reasons, firstly because they run in the main
thread and could stall nuke and secondly
because the cache cannot be guaranteed to be correct.
* If you wish to sample an entire image to perform an average operation
(for example), this should be done by locking a thread within engine
until the image has been sampled.
This is because engine runs with worker threads but not the main
thread. However, this means that you cannot set the values of knobs here.
* Instead, to set a knob as the result of an engine call you need to
use execute() to lock and execute a branch of the node tree.
So my question is that if you need to sample an input image to construct
an internal node tree that generates the output of the node, how would
you do it and where do you sample the data if doing so within validate()
is unreliable and doing so within engine() is too late? Do you need to
use the Execution class and if so, how can you force it to execute from
within a node automatically without having to draw the render dialog and
ask for user input?
If anyone can help with this I would be really grateful; I have
encountered this issue many times and at least four of our nodes require
this to be solved.
Thank you,
Luke
_______________________________________________
Nuke-dev mailing list
[email protected]
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev