Hi all,
I'm trying to randomize the hash of my Op, to make sure it is evaluated
every time. I tried doing this:
virtual void append(Hash &hash)
{
hash.append(rand());
std::cout << "New hash: " << hash.getHash() << std::endl;
}
When changing the current frame in Nuke, I can see that append() is
being called and the hash changes, but then Nuke doesn't always call the
'engine' function as a consequence. It simply uses the previously cached
frame.
I need this functionality because my Op can be in a state where it's not
possible to compute a correct output, but I don't want to throw an error
either, allowing the user to work with an 'approximate' output until the
output can be computed again. Think of a file reader where the input
file is not always available, in which case the hash is randomized and
data is read from a proxy file instead.
If the above doesn't work, I wonder how people implement correct file
readers. I would implement it by appending the modification date of the
file to the hash, so it gets re-evaluated whenever the file changes. But
if a change in the hash doesn't imply that the frame is being
re-evaluated, this would be kind of pointless...
Thanks,
Peter Kaufmann
_______________________________________________
Nuke-dev mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev