houio icon indicating copy to clipboard operation
houio copied to clipboard

String attributes are not stored by points

Open eprana opened this issue 4 years ago • 2 comments

Hi,

String attributes are not stored by points.

When iterating through houio::HouGeo::AttributeAdapter::Ptr, (retrieved with houio::HouGeo::getPointAttributeNames() ), string attributes are not stored by points. HouGeo::HouAttribute::getString() only returns unique values of a specific attribute. For instance, there are 10 points with a string attribute. The value of this attribute is "A" or "B" according to point id (even or odd). attribute->getNumElements() returns 2 instead of 10

Is there an index by point somewhere to get the value of this attribute for each point ?

eprana avatar Jul 16 '20 09:07 eprana

Hi, the information about this must be somewhere, like an index table, but it is not read or at least not interpreted/unpacked as you would expect. So it seems like duplicate string attributes on points are not functional like this. As a workaround you may be able to enforce a unique string per point by appending the point index to the string when generating the attribute values in houdini.

Sorry for the inconvenience. Looked at this repo the first time after a couple of years and find myself surprised that some people are actually using it :D

dkoerner avatar Jul 16 '20 11:07 dkoerner

Hi, To be honest, I wasn't expecting a answer :laughing: I submit a PR to solve this issue, if you have time to look at it : #8

eprana avatar Jul 20 '20 11:07 eprana