Thanks for your reply.
I'm calling srand(time(NULL)); in the constructor of the Op. So the
hashes are very likely to be unique. I also tried mixing a global int
variable into the hash and (atomically) increment that every time the
hash is computed. Same result.
If I modify the inputs to my Op, then jump from frame 1 to frame 2 in
Nuke, both frames are computed as expected. However jumping back and
forth between frames 1 and 2 after that, new hashes are computed every
time, but engine() is not called again.
Is it possible that the viewer is caching the data, ignoring the Op hash
for some reason? But then, why is the Op hash even being computing?
Best,
Peter
On 21.11.2011 10:04, Peter Pearson wrote:
On 21/11/11 08:57, Peter Kaufmann wrote:
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.
How are you seeding the rand() call - that's probably the issue - it's
generating the same numbers in sequence each time.
However, it would be better to append something totally unique, like
the current time - that way you can guarantee that the data won't be
in Nuke's cache...
Regards,
Peter
--
-------------------------------------------
Peter Kaufmann
The Walt Disney Studios (Schweiz) GmbH
CLW B 2, Clausiusstrasse 49
8092 Zurich, Switzerland
[email protected]
Phone: +41 44 6323215
_______________________________________________
Nuke-dev mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev