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.
Question about getting HAPI_ATTROWNER_VERTEX attributes from the hda file
3042 2 0- VincentKK
- Member
- 6 posts
- Joined: Oct. 2018
- Offline
- seelan
- Member
- 571 posts
- Joined: May 2017
- Offline
How are you querying the vertex attribute data?
Something like this should just work:
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);
- VincentKK
- Member
- 6 posts
- Joined: Oct. 2018
- Offline
seelanHi,
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);
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