Python callback to run every time any HDA parameter change

   190   2   0
User Avatar
Member
12 posts
Joined: June 2016
Offline
Hello,
I am trying to find the best way to hook up a python callback to write the data from my HDA menu into a json file (a dictionary that stores all the data)

At the moment I have added for each parameter the same python callback in the callback script section:

hou.phm().export_json(kwargs)

although I find this a little, well, brutal???

Would there be a better way to do this you reckon?

Any advice would be great

Many thanks
User Avatar
Member
9434 posts
Joined: July 2007
Offline
You can probably register node event callback [www.sidefx.com] for each HDA instance to handle hou.nodeEventType.ParmTupleChanged

You likely want to add it during HDA's OnLoaded callback as the node event callbacks don't persist between sessions
Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
12 posts
Joined: June 2016
Offline
OH yep this works pretty well for me thanks a lot @tamte
Edited by Patoz - Feb. 19, 2026 15:19:49
  • Quick Links