Jump to content
Gaussian_Guaicai

How to get a callback event on cook?

Recommended Posts

I been coding the callback event in a HDA with Python, the goal is to call every time the node is cooked(after the cook); But it seem not such event type in hou.nodeEventType and hou.hdaEventType.

I was write the hou.Node.addEventCallback() in OnCreate event handler section to setup different event type callback.

Is there any way to write a callback in HDA for something like "OnCook" event?

Edited by Gaussian_Guaicai

Share this post


Link to post
Share on other sites

You might want to use Object/Python Script or Sop/Python SOP nodes for this. Or create a new "Python based" operator via File -> New Asset > Python type and you'll be able to put your cooking code into the Code section of the operator

Share this post


Link to post
Share on other sites

That will be a lot coding just using Python.... So its no way to add a special "OnCook" event type to callback for it?

I was able to achieved similar callback by using hou.Node.addParmCallback() to test parameter change with the expression "nprim()" or "npoint()" inside the HDA output node, it actually working great even the number of the primitives from input not change as long as the upstream is cooked.

Edited by Gaussian_Guaicai

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

×