How to add a parameter change callback to sop geometry out nodes permanently?

   2068   2   1
User Avatar
Member
150 posts
Joined: Feb. 2009
Offline
I have a callback that I can use to monitor changes to string attribs (in a multiparm) on a node with the standard method-
node.addEventCallback((hou.nodeEventType.ParmTupleChanged, ), parm_changed)
…Problem is this disappears after closing the scene.

I'd like instead to be able to add the callback to these rop geo out (sop) nodes permanently if a function is executed, and not necesarily to all rop geo nodes. Currently the callback wont last between hip sessions.

The 456.py file is one potential avenue, adding them all again on scene load, but I'd like to avoid that if possible.

I should mention the multiparm will be created by a parmTemplate, but adding a callback to each instance of a text string on the multiparm may be potentially risky with large numbers of them, so I should probably avoid that path.

I believe the advantage of hou.nodeEventType.ParmTupleChanged is that it will more elegantly handle too many parms changing at once, which can occur when entries are deleted on multiparms - since it will return None in that circumstance and you can handle that situation if it occurs.

Thanks if you can throw any ideas my way.
Edited by Andrew Graham - July 29, 2019 08:47:49
https://openfirehawk.com/ [openfirehawk.com]
Support Open Firehawk - An open source cloud rendering project for Houdini on Patreon.
This project's goal is to provide an open source framework for cloud computing for heavy FX based workflows and allows end users to pay the lowest possible price for cloud resources.
User Avatar
Member
900 posts
Joined: Feb. 2016
Offline
To have them persistent across sessions I guess you could register the node events inside an onLoaded event handler of a digital asset created for that specific purpose?
Edited by Andr - July 30, 2019 03:56:42

Attachments:
registernodes.JPG (45.2 KB)

User Avatar
Member
150 posts
Joined: Feb. 2009
Offline
Thanks for your reply Andr!

Because we are talking about applying it to out of the box sop rop geometry nodes (not a custom digital asset, but a parm template applied to those nodes), then I don't know how to achieve that.
https://openfirehawk.com/ [openfirehawk.com]
Support Open Firehawk - An open source cloud rendering project for Houdini on Patreon.
This project's goal is to provide an open source framework for cloud computing for heavy FX based workflows and allows end users to pay the lowest possible price for cloud resources.
  • Quick Links