danielsweeney Posted March 17, 2020 Share Posted March 17, 2020 HI everyone. Hope everyone is ok in this current situation. Hope no one is Ill from the virus and not going crazy working from home. I am wondering if someone can point me in the right direction on this. I have a Multi-input HDA - I assumed that the OnInputChange HDA event would trigger when a name change of node that is connected. But for some reason, it does not. What would be the best way to listen for this event happening. The event triggers fine the first time the node in plugged in, but not when the node changes name. Any help would be appreciated. Cheers Daniel Quote Link to comment Share on other sites More sharing options...
anim Posted March 17, 2020 Share Posted March 17, 2020 (edited) depending on what you are doing you may be able to use opinput() or opinputpath() expression to grab the name or path of any input node and will correctly update when you rename the inputs Edited March 17, 2020 by anim Quote Link to comment Share on other sites More sharing options...
Stalkerx777 Posted March 17, 2020 Share Posted March 17, 2020 Right, as Tomas said a parameter expression might work for you, if not, then what you can do is in your onInputChanged handler of your hda, you would register a callback on the node's inputs. (Simplified, untested) def _callback(): pass for inp in hda_node.inputs(): inp.addEventCallback([hou.nodeEventType.NameChanged], _callback) You will need to take care of removing the callback if it's there already before adding a new one. Quote Link to comment Share on other sites More sharing options...
danielsweeney Posted March 19, 2020 Author Share Posted March 19, 2020 Hi, thanks for the responses Alex and Thomas. to be honest the opinput() would work for my solution. but only if I could get all inputs going into a multi-connector? and it then Registered it on the Parm so i could run a call back script. But from what I have tested. the callback script does not run when its has an expression in the parm and the output changes when it pulls the new name? I will have to have a proper think about doing it with node event types as I have no experience of this and I am very much on a learning path with python....:S the joys of coding when you dont have a coding brain. ha Daniel 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.