Hi, I've been trying to create a simple graph with the purpose of having it run specific functions each time a node finishes cooking, ending with a final cook complete message when the whole graph has finished cooking. Following the examples found at in the docs at
https://www.sidefx.com/docs/houdini/tops/events.html. [
www.sidefx.com]
I get the desired result regarding a final “Graph cook Complete!” message when applying a addEventHandler(print_done, pdg.EventType.CookComplete) to the pdg.GraphContext. However I also want each node in the graph to print it's name to the console when that specific node has finished cooking. This I can't get to work. I tried fetching a pdg_node with
pdg_node = topnet.node('mysubnode').getPDGNode()then create a simple function:
print_subnode(event):
print("subnode has cooked!")
I applied it as following
pdg_handler = pdg_node.addEventHandler(print_subnode, pdg.EventType.CookComplete)
This does print out “subnode has cooked!” but not until the entire graph has finished cooking. How do I get it to print instantly after the “mysubnode” has finished cooking?