Capture PDG Errors?

   190   4   0
User Avatar
Member
12 posts
Joined: June 2018
Offline
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
User Avatar
Staff
430 posts
Joined: May 2017
Offline
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?
User Avatar
Member
12 posts
Joined: June 2018
Offline
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.
Edited by LithLoren - Sept. 12, 2019 20:15:49

Attachments:
Annotation 2019-09-12 171443.png (109.8 KB)

User Avatar
Staff
430 posts
Joined: May 2017
Offline
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.
User Avatar
Staff
430 posts
Joined: May 2017
Offline
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.
  • Quick Links