Jump to content
catchyid

hda to get called back when hip file saved?

Recommended Posts

hi,

I am developing an hda, and some of its parameters need to update themselves when the file is saved (e.g. if the user changes the file name, then i need to run a code in hda to update some paths accordingly). I found some event handlers (e.g. on Created, On Loaded, ...), but could not find a handler such as (On File Saved?) ...

image.thumb.png.a1fbf84a0714c18506758cdaf894737a.png

thx,

Share this post


Link to post
Share on other sites

you can use hou.hipfile.addEventCallback()  to register a callback for when the hipfile is saved

you can add this code in the HDA python module, or (depending on what you want to do), put it in the 'On Created' event handler to register it when the node is created, or the hipfile is loaded.  You will probably also want to check for any existing callbacks before setting a new one

https://www.sidefx.com/docs/houdini/hom/locations.html#scene_events

https://www.sidefx.com/docs/houdini/hom/hou/hipFile.html

 

  • Like 2

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×