eyevex Posted October 14, 2015 Share Posted October 14, 2015 I thought I had stumbled across this at some time via hscript or hython... Basically checking an unlocked HDA defined node to see of any different since saved last. I would think matchesDefinition() would serve this purpose but seems identical to isLocked() Proof seems to be getting a py ref to a hda defined node, test... True, then unlock -- no other changes... test... False. I could make some ugly use of modification stamp ... but this has its own issues ... I unlocked, RMB save is always enabled even before any modification is made. If saved anyway stamp is updated... Thoughts? [eyevex] (|;-D> Quote Link to comment Share on other sites More sharing options...
eyevex Posted October 14, 2015 Author Share Posted October 14, 2015 The only idea I currently have that would seem reliable.... extract definition contents, parse contents section and compare the node graph against it. This would be a bit more time than I have to gain this functionality right now and would have to assume something exosts that could get me closer as a starting point.... ir not? (|;-D> Quote Link to comment Share on other sites More sharing options...
Jason Posted October 16, 2015 Share Posted October 16, 2015 You could try the new 'otldiff' command-line tool in Houdini 15 $ otldiff otldiff: Wrong number of OTL paths specified. otldiff 1/infinity Description: Visually compare the contents of two OTLs. Similar to 'svn diff'. Usage: otldiff [options] file.otl otldiff [options] fileA.otl fileB.otl Options: -h, --help Print this message -r, --revision Specify revision(s) to compare. Examples: Compare two OTLs: otldiff oldfile.otl newfile.otl Compare current with a previous revision: otldiff -r 12345 current.otl Compare two distinct revisions: otldiff -r 1234:6789 file.otl Quote Link to comment Share on other sites More sharing options...
eyevex Posted October 17, 2015 Author Share Posted October 17, 2015 I'm not sure that'll work in this case. Although I was unaware and that is super useful to know … Although it does have some possibilities but they could get ugly.. and involve a lot of definition swapping. I wrote the subject line quickly... # More accurately …. lets say …. my_node = hou.node('/some/meaningful/oppath') my_nodes_def = my_node.type().definition() # Now we edit the contents …. my_node.allowEditingOfContents() #…. Now in the net pane you can save. This would change the def and stamp ala ... my_nodes_def.modificationTime() # as well as potentially some other user oriented data # these will always return the same values my_node.isLocked() my_node.matchesCurrentDefinition() # ….. So in terms of both representation and functionality and preferably without custom parsing the contents of the different sections of … my_nodes_def.sections() # … and attempting to compare it to the current node graph and parameter interface, script section etc .. know if the unlocked my_node has actually changed (beyond time stamp and user etc .. that goes with saving when no changes have happened) from how it is described by my_nodes_def ...I spouse more options for saving and update from node mechanism would solve this too where there was a force option or wouldn't save when there were no changes… but am trying to do something that I can work with now. Hopefully the problems a little clearer. (|:-D> Quote Link to comment Share on other sites More sharing options...
eyevex Posted October 22, 2015 Author Share Posted October 22, 2015 Hmmm starting to think this may not exist -- something similar to hipFile.hasUnsavedChanges() but for unlocked node instances would seem to be what I was after... might have to look at implementing something. Quote Link to comment Share on other sites More sharing options...
anim Posted October 23, 2015 Share Posted October 23, 2015 according to help hou.Node.matchesCurrentDefinition() should be doing thatas it says: Return whether the contents of the node match its type definition. A locked digital asset instance will always match its definition, but an unlocked one may not. so if it's not doing that maybe report a bug Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.