I ran into an issue like this while writing a hash-based switch node. Here’s
the code Nuke uses to calculate the embedded metadata hash:
Hash Write::getHashOfInputs()
{
Hash inputHash;
if ( inputs() > 1 ) {
// split input ( eg. stereo )
for ( int i = 0 ; i < inputs(); i++ ) {
inputHash.append( input(i)->hash() );
}
}
else {
inputHash = input0().hash();
}
return inputHash;
}
Notice that it uses the hash of the incoming node, so just check the
.opHashes() value of the input and it should match. However, you probably won’t
be able to reliably reproduce this in a multi-view comp, since you have no way
of building your own Hash at the Python level.
Finally, in order to do direct comparisons, you’ll either need to convert the
.opHashes return to hex, or the metadata value to a long.
Hope this helps,
-Nathan
From: robingraham
Sent: Wednesday, July 13, 2011 11:57 AM
To: [email protected]
Subject: [Nuke-python] opHashes() not matching nuke/node_hash
Does anyone know how to compute the hash that is written to a exr in the
nuke/node_hash metadata?
I see the value that is written to a exr, but it doesn't match the hash I get
back when I computer a opHashes() for that write node. I just want to see if
anything upstream of the write node has changed which would make the written
exr no longer valid and up to date. What am I doing wrong?
--------------------------------------------------------------------------------
_______________________________________________
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