I'm creating 2 tetrahedrons in my geo, with a Prim attribute named 'X', of type float.
The first tetra has 'X' = 4 and the 2nd one has 'X' = 42, as you can see here :
Later on, I'm using HAPI in C++ to retrieve the value of this attribute in my geo.
Surprisingly, I get an array such as: {4, 4, 4, 4, 42, 42, 42, 42} when I'm expecting {4, 42}
From what I understand, this is because my 2 tetras have 8 points in total:
I'm saying this because I had only 1 tetra in my geo in the first place, and I got 4 values instead of 1.
But I don't get how the number of points can have an impact on the number of values of my 'X' attribute?
I wonder if I'm missing the big picture here and simply not getting the philosophy of Houdini.
I think it's pretty unlikely that HAPI has a bug on such a core feature.
As a matter of fact, when using HAPI in python, with the code:
geo.primFloatAttribValues('X')
(4.0, 42.0)
But that's not the case with the C++ HAPI which is returning {4, 4, 4, 4, 42, 42, 42, 42} as I said earlier.
And I'm only interested in a C++ solution.
What am I doing wrong then? Thanks.