kgoossens Posted November 10, 2017 Share Posted November 10, 2017 Hi everyone, I need to be able to change a value inside my otl based on any parameter change of the otl. Is there a method to check that? Cheers, Kim Quote Link to comment Share on other sites More sharing options...
MrScienceOfficer Posted November 10, 2017 Share Posted November 10, 2017 You can add a callback on the node. node.addEventCallback(hou.nodeEventType.ParmTupleChanged, call_func) I think that covers all parms, not just parmTuples but I'm not sure. Quote Link to comment Share on other sites More sharing options...
galagast Posted November 10, 2017 Share Posted November 10, 2017 Hi, I tested this out. Hopefully the attached HDA example is something close to what you're after. Changing the parameters of HDA will also affect a node's parameter inside it. I assigned the ParmTupleChanged callback through the onCreated event (and removed the callback through the OnDeleted event). Although whenever saving the definition, an error pops up. It seems to error out due to a function eval() call to an undefined variable - which will only be filled after the callback fires. I'm not sure how to bypass that >__< H16.5.268 Indie - otl_parm_callback.hdalc On a side note, the example on the docs for the usage of a .ParmTupleChanged (under the addEventCallback) is probably incorrect.. I found this thread which suggested the correct syntax. Quote Link to comment Share on other sites More sharing options...
MrScienceOfficer Posted November 11, 2017 Share Posted November 11, 2017 Another option would be to mirror your HDAs interface on a python node so when any parameter changes the node will be cooked. 1 Quote Link to comment Share on other sites More sharing options...
kgoossens Posted November 13, 2017 Author Share Posted November 13, 2017 Thanks Tom and Jeff for the help! The addEventCallback was exactly what I was looking for. 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.