Question about getting HAPI_ATTROWNER_VERTEX attributes from the hda file

   3074   2   0
User Avatar
Member
6 posts
Joined: Oct. 2018
Offline
Hello,

I made a test hda file for HAPI testing, and I tried to get the attributes from the ‘Part’, and when the attribute owner was ‘HAPI_ATTROWNER_POINT’, ‘HAPI_ATTROWNER_PRIM’ or ‘HAPI_ATTROWNER_DETAIL’, it worked well, I got all the data from those 3 owners.

But when the owner is ‘HAPI_ATTROWNER_VERTEX’, the attributeCounts of HAPI_PartInfo is 0, anyone knows what the problems is? I can see the vertex data in Houdini.

Attachments:
test_all_attributes.hda (4.3 KB)
QQ图片20181030180224.png (18.1 KB)

User Avatar
Member
571 posts
Joined: May 2017
Offline
How are you querying the vertex attribute data?

Something like this should just work:
HAPI_GetAttributeInfo(session, nodeId, geoId, 0, "test_vertex_float", HAPI_ATTROWNER_VERTEX, attributeInfo);
HAPI_GetAttributeFloatData(session, nodeId, 0, "test_vertex_float", attributeInfo, -1, dataArray, 0, attributeInfo.count);
User Avatar
Member
6 posts
Joined: Oct. 2018
Offline
seelan
How are you querying the vertex attribute data?

Something like this should just work:
HAPI_GetAttributeInfo(session, nodeId, geoId, 0, "test_vertex_float", HAPI_ATTROWNER_VERTEX, attributeInfo);
HAPI_GetAttributeFloatData(session, nodeId, 0, "test_vertex_float", attributeInfo, -1, dataArray, 0, attributeInfo.count);
Hi,
Thank you for the reply. I get the PartInfo like this:
HAPI_GetPartInfo(nullptr, m_nAssetNodeId, nPartId, &sPartInfo)
and the attributeCounts array of sPartInfo is (0, 11, 2, 3), corresponding to HAPI_ATTROWNER_VERTEX, HAPI_ATTROWNER_POINT, HAPI_ATTROWNER_PRIM and HAPI_ATTROWNER_DETAIL, meaning that there is no attribute when the owner is HAPI_ATTROWNER_VERTEX, the counts of the other 3 owners are correct.

I have tried:
HAPI_GetAttributeInfo(nullptr, m_nAssetNodeId, nPartId, “test_vertex_float”, HAPI_ATTROWNER_VERTEX, &sAttrInfo);
both the m_nAssetNodeId and the nPartId were 0,
and after the execution of this function, sAttrInfo.exists was false, the values of other member variables were -858993460, obviously, the sAttrInfo was invalid.

I wonder if there are some problems in the hda file.
Edited by VincentKK - Oct. 31, 2018 13:56:33
  • Quick Links