i'm looking for accessing to an HDA custom attributes in unity by script.
for example, my HDA contain a primitive attribute “address”(an integer)
is it possible to know in unity the value of this attribute for a specific primitive of my HDA ?
HEU_HoudiniAssetRoot myroot = (HEU_HoudiniAssetRoot)curSelected.GetComponent<HEU_HoudiniAssetRoot>();
HEU_HoudiniAsset myhda = myroot._houdiniAsset;
// get parameters
HEU_ParameterData paramData = myhda.Parameters.GetParameter("princ_etages");
outvalue = paramData._intValues[0];
Debug.Log(outvalue);
// get attributes
HAPI_AttributeInfo attr_info;
attr_info.owner = HAPI_AttributeOwner.HAPI_ATTROWNER_PRIM;
attr_info.storage = HAPI_StorageType.HAPI_STORAGETYPE_INT;
attr_info.count = 0;
attr_info.tupleSize = 1;
HEU_AttributeData testdata = HAPI_GetAttributeIntData.GetAttributeIntData(null,0,0,"adresse", attr_info,0,1,0,1);
HEU_SessionBase session = GetHoudiniSession(true); HAPI_AttributeInfo addressAttrInfo = new HAPI_AttributeInfo(); int[] addressAttrData = new int[0]; HEU_GeneralUtility.GetAttribute(session, 0, 0, "address", ref addressAttrInfo, ref addressAttrData, session.GetAttributeIntData);