Can I get the overall cook state easily?

   2095   3   0
User Avatar
Member
159 posts
Joined: Feb. 2018
Offline
I want to get the overall cook state's information like the new PDG toolbar UI. On how many nodes or work items have been cooked, and how many been waiting for cooking.
Now I use code like this:
ctx = node.context
workitems = [i.state for n in ctx.graph.nodes() for i in n.workItems]
completes = workitems.count(pdg.workItemState.CookedSuccess)
And I want to get reported (print some logs) for every work item when it get cooked, so I put the code to the WorkItemStateChange EventHandler.
It works but sometimes the work item hanging on cooking state and never gets cooked. So is there any convenient way to do such thing?
Thanks.
Edited by EricSheng - June 16, 2020 02:10:51
User Avatar
Member
17 posts
Joined: Feb. 2019
Offline
Which version of Houdini are you using?
Edited by joabs - June 16, 2020 13:24:03
User Avatar
Member
159 posts
Joined: Feb. 2018
Offline
joabs
Which version of Houdini are you using?
18.0.391
User Avatar
Member
17 posts
Joined: Feb. 2019
Offline
Unless you're seeing wrong information in the toolbar or in the TOP nodes, it is safe to assume the events are correct, as both relies on them. You might be running into data race issues, try using a lock around your code.
  • Quick Links