getting data from HDA with multiple outputs

   2022   7   1
User Avatar
Member
71 posts
Joined: March 2007
Offline
Hi there,

We are investigating if we can use HDA's with multiple outputs.
Apparently there is HAPI_AssetInfo::geoOutputCount but can we actually get data from all outputs?
And if not then has anyone a good workaround?

We were able to find the Output Sop nodes inside the HDA with some custom code but when trying to get data from those nodes directly we get an empty HAPI_GeoInfo.

Or does it have something to do with the display flag? Guess that functionality overlaps or conflicts with the Output Sops


edit:
So apparently our workaround with using the Output Sops worked.
If there is a way to stay on HDA level rather than dive inside then please let me know.


cheers,
benS
Edited by ben5ch - Feb. 14, 2020 11:36:25
User Avatar
Member
21 posts
Joined: March 2019
Offline
Hi guys,

I can confirm a need for this as well.

Ben could you pls share your solution to access the geo data for multiple output nodes? I have a simple code but I keep getting empty GeoInfo.
You have mentioned you had issues with it as well so I was wondering what was the solution.

Here is my simplified code:
int geoCnt = 0;
vector< T_HoudiniNodeId >nodesIds;
ENSURE_SUCCESS(HAPI_ComposeChildNodeList(m_Session->GetPtr(), m_AssetInfo->nodeId, HAPI_NODETYPE_ANY, HAPI_NODEFLAGS_ANY, false, &geoCnt));
nodesIds.resize(geoCnt);
ENSURE_SUCCESS(HAPI_GetComposedChildNodeList(m_Session->GetPtr(), m_AssetInfo->nodeId, &nodesIds[0], geoCnt));

for (auto& geoId : nodesIds)
{
    HAPI_AssetInfo assetInfo;
    ENSURE_SUCCESS(HAPI_GetAssetInfo(m_Session->GetPtr(), geoId, &assetInfo));
    C_String const fullOpNameSH = m_Session->GetString(assetInfo.fullOpNameSH);
    if (fullOpNameSH == "Sop/output")
    {
        outGeoIds.push_back(geoId);
    }
}

for (HAPI_NodeId geoId : geoIds)
{
    HAPI_GeoInfo geoInfo;
    ENSURE_SUCCESS(HAPI_GetGeoInfo(m_Session->GetPtr(), geoId, &geoInfo));
    /*have geoInfo.partCount == 0 :(*/
    ...
}

Do you guys have an idea what I might be missing?
Cheers
Tom
User Avatar
Member
571 posts
Joined: May 2017
Offline
We'll have to add a new API to get the output node IDs directly. Please submit an RFE to track this. Thank you.
User Avatar
Member
21 posts
Joined: March 2019
Offline
Thank you Seelan,

I will take care of the ticket Btw do you have any idea why the above code does not work? From the node info I believe I have retrieved the correct output nodes ids, but I fail to get any data out of it.

Cheers
Tom
Edited by tpastyrik2k - May 6, 2020 04:52:41
User Avatar
Member
571 posts
Joined: May 2017
Offline
You have to cook each of the output nodes before you can query geometry data from them (so add a HAPI_CookNode just before the HAPI_GetGeoInfo). Usually we cook the display node before getting the geometry. In this case, depending on how you setup the network, you might have to cook each output node separately.
Edited by seelan - May 6, 2020 07:16:12
User Avatar
Member
21 posts
Joined: March 2019
Offline
Ah, that did not occur to me as I was cooking the whole hda right before that. Also in the output nodes details in HAPI_AssetInfo I saw that the node has been cooked which is a bit confusing. I will try thanks
User Avatar
Member
71 posts
Joined: March 2007
Offline
Hi Tom,

We have been working around this because tool coder time is the most valuable for us. *
Our implementation was not generally supporting any HDA but had a single HDA it should work with.
So we simply hard coded the paths to the other Output nodes.
Which has already bitten me when I wanted to rename those nodes. :-(

thanks for the RFE..

cheers,
benS

* if you are a coder and interested in working on PlayStation games then give me a message ;-)
User Avatar
Member
21 posts
Joined: March 2019
Offline
Hi everyone,

thank you all for answers, the dynamic workaround I posted above started indeed working when I cooked the output nodes again explicitly! This unblocks me, the RFE is still valid I believe, looking forward to direct api for this

Thanks
Tom
  • Quick Links