Jump to content

hda to get called back when hip file saved?


catchyid

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,

Link to comment
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
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...