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
Capture PDG Errors?
3861 4 0- LithLoren
- Member
- 13 posts
- Joined: 6月 2018
- Offline
- seelan
- Member
- 571 posts
- Joined: 5月 2017
- Offline
- LithLoren
- Member
- 13 posts
- Joined: 6月 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.
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 - 2019年9月12日 20:15:49
- seelan
- Member
- 571 posts
- Joined: 5月 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.
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
- Member
- 571 posts
- Joined: 5月 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