Null string. Should never see this! When getting detail attr

   6804   0   0
User Avatar
Member
21 posts
Joined: March 2019
Offline
Hi,

I am enumerating all the detail attribs names like this:
UE_ASSERT(0xad0cf41, E_HOUDINI_ATTROWNER_INVALID < attributeOwner && attributeOwner < E_HOUDINI_ATTROWNER_MAX);
int attributeCnt = m_PartInfo->attributeCounts[attributeOwner];
			
std::vector<T_HoudiniStringHandle> stringHandles;
stringHandles.resize(attributeCnt);
HAPI_Result res = HAPI_GetAttributeNames(m_Session->GetPtr(), m_GeoId, m_PartInfo->id, HAPI_ATTROWNER_DETAIL, &stringHandles[0], attributeCnt);

UE_ASSERT(0xd7a0f3ff, res == HAPI_RESULT_SUCCESS);

uestd::vector<C_String> attributeNames;
attributeNames.reserve(attributeCnt);

for (auto handle : stringHandles)
{
	int buffer_length = 0;
	HAPI_Result res = HAPI_GetStringBufLength(m_Session, handle, &buffer_length);
	UE_ASSERT(0xe9c3b2e7, res == HAPI_RESULT_SUCCESS);

	uestd::string str;
	str.resize(buffer_length);

	res = HAPI_GetString(m_Session, handle, &str[0], buffer_length);
	UE_ASSERT(0xde863b29, res == HAPI_RESULT_SUCCESS);

	attributeNames.push_back(str.c_str());
}

And I am getting only “Null string. Should never see this!” in all the values, whats wrong? This approach works for anything but detail attribs in my usecase. Under which circumstances can this happen?

Number of detail attribs is ok, the values nope.

Please help!
Thanks
Tom
  • Quick Links