PDG Work Item path?

   832   2   0
User Avatar
Member
12 posts
Joined: June 2018
Offline
For context, we are in the processes of integrating more robust PDG support in our engine (C++). We have been using the Unity plugin as guidance.

Based on the unity plugin, it looks like you are able to get the output path from the resulting work items:

HAPI_PDG_WorkitemResultInfo[] resultInfos = new HAPI_PDG_WorkitemResultInfo[workItemInfo.numResults];
int resultCount = workItemInfo.numResults;
if (!session.GetWorkitemResultInfo(topNode._nodeID, eventInfo.workitemId, resultInfos, resultCount))
...
string tag = HEU_SessionManager.GetString(resultInfos[i].resultTagSH, session);
string path = HEU_SessionManager.GetString(resultInfos[i].resultSH, session);

Should we get the same results using the C++ API:
std::vector<HAPI_PDG_WorkitemResultInfo> resultInfos(workItemInfo.numResults);

HAPI_GetWorkitemResultInfo(&session->m_Session, id, eventInfo.workitemId, resultInfos.data(), workItemInfo.numResults);

for (HAPI_PDG_WorkitemResultInfo& info : resultInfos)
{
	CStringA sName = GetHoudiniString(&session->m_Session, info.resultSH);
	CStringA sTag = GetHoudiniString(&session->m_Session, info.resultTagSH);
}

Cooking the HDA from the sample project files here(https://www.sidefx.com/tutorials/pdf-for-indie-gamedev-section-2-getting-set-up/?collection=61) It does generate the resulting bgo.sc files, but the resulting strings from the work items are empty. Is this expected?
User Avatar
Staff
479 posts
Joined: May 2017
Offline
Make sure that the id you are passing into HAPI_GetWorkitemResultInfo is the correct TOP node, and also check that the returned work item info has valid data.
User Avatar
Member
12 posts
Joined: June 2018
Offline
That was it. I was passing the Graph Context ID instead of the TOP node ID. Thank You!
  • Quick Links