Search - User list
Full Version: Capture PDG Errors?
Root » Houdini Engine API » Capture PDG Errors?
LithLoren
What’s the correct way to capture errors within the PDG graph?

If I kick a PDG node cook using HAPI_CookPDG(&session->m_Session, nTopNode, false, false) then process the PDG events using HAPI_GetPDGEvents, we appear to get some events in the HAPI_PDG_EVENT_NULL state, but we never get any other states if it encounters an error.

If I export the scene to a HIP file, I can dive into the node with an error to get more info. I would assume I should be getting a HAPI_PDG_EVENT_COOK_ERROR but it does not seem to be the case.

We are currently on version 17.5.350
seelan
You should be getting a HAPI_PDG_EVENT_COOK_ERROR when a work item fails to cook for a PDG node. It is odd that you are getting HAPI_PDG_EVENT_NULL. Do you have a reproducible HDA that we can test with?
LithLoren
My mistake, we are getting HAPI_PDG_EVENT_COOK_ERROR, the event info’s current state is HAPI_PDG_WORKITEM_UNDEFINED.

I’m still unclear how to get the error result string that you can normally get from the PDG graph.


Calling: HAPI_GetStatusStringBufLength(pSession, HAPI_STATUS_COOK_RESULT, HAPI_STATUSVERBOSITY_ALL, &nBuferLen);

Results in: Cook succeeded.

When I would expect:
Error
Warning: Bad parameter reference: “../../floatrange2x” in parameter /obj/PDG2/topnet1/wedge1/floatrange2.


I thought I might need to get it from the work item result info, but if I call HAPI_GetWorkitemInfo(&session->m_Session, id, eventInfo.workitemId, &workItemInfo); to try to Get the work item results info, GetWorkItemInfo returns HAPI_RESULT_INVALID_ARGUMENT.
seelan
Unfortunately, currently the cook error message is not accessible via HAPI. For the HAPI_PDG_EVENT_COOK_ERROR, the work item info (states) is invalid because the event was generated from the node, not a specific work item.

I am working on a fix for this which will allow you to query the cook error (or any pdg cook event message) from the event. Will let you know when it is in.
seelan
In today's build (17.5.379), I added a new member msgSH to HAPI_PDG_EventInfo. This is set when a cook event has a message (typically a node error), which can then be looked up later via the string handle and HAPI_GetString. The message string handle is valid until the next PDG cook. Bumped up the HAPI version to 3.2.44.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB