Thanks for the reply, but I have actually decided to scrap the whole
underlying technique and try something else.  Unfortunately I had missed
a real obvious flaw in using hash values, and that is animation :)
Silly mistake, but oh well.  So I'm moving on with another technique.
That said, I appreciate the reply.  It introduced me to a new function
that I was unaware of :)

 

We should have an API Function of the Day calendar :)

 

 

From: [email protected]
[mailto:[email protected]] On Behalf Of Ean
Carr
Sent: Friday, December 09, 2011 6:21 AM
To: Nuke Python discussion
Subject: Re: [Nuke-python] Save a snapshot of a node's state?

 

How about using writeKnobs()? Something like this:

mynode.writeKnobs(nuke.WRITE_NON_DEFAULT_ONLY | nuke.TO_VALUE).split()

I'm writing non default knobs only so that you only get knobs which the
user actually changed. Maybe you could put them in a dictionary so,
then, when you want to check if the user's changed something, do
writeKnobs() again and check for any new knobs with hasKey(). Of course,
you'd check existing knobs' values, too. Could be a start?

Cheers, Ean



On Thu, Dec 8, 2011 at 4:49 PM, John Vanderbeck
<[email protected]> wrote:

Hey all,

I am trying to walk through all my nodes and save a "snapshot" so to
speak, something that I can store and then later go back and check
again, and compare to see if the node has been modified by the user.

My original thought on this was to store the opHashes of the node, but
I'm running into severe problems with this method.  

For one, the hashes sometimes appear as though they don't even update at
all unless you close and re-open the properties panel.

Secondly, it appears that changing a node upstream will cause a node
downstream to change its hash.  This makes sense of course, but it
results in me recording that the wrong node was changed.  Maybe I can
walk through and disconnect everything temporarily when saving the
state, but that might open another can of worms.

Tl;dr I need to snapshot the state of the script in some efficient
manner that allows me to then compare with a second snapshot later on
and determine what nodes have been changed. 

John Vanderbeck

Technical Artist

Digital Domain Media Group

NOTICE: This communication may contain privileged or other confidential
information. If you have received it in error, please advise the sender
by reply email and immediately delete the message and any attachments
without copying or disclosing the contents. Thank you. 


_______________________________________________
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