Arthur Cousseau

arthur.cousseau

About Me

Connect

LOCATION
Not Specified
ウェブサイト

Houdini Engine

Availability

Not Specified

Recent Forum Posts

HAPI won't return the expected number of attribute values 2024年5月30日9:41

Hello,
I've created this topic in Technical Discussion but it could also belong to this category:
Click here to go [www.sidefx.com]

HAPI won't return the expected number of attribute values 2024年5月30日9:35

Hello,
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')
I do get the expected values:
(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.

HDK: OPgetDirector() returns nullptr 2024年5月14日11:38

Hi, I'm trying to run simple examples such as: Management of HDAs and OTLs in Houdini
[www.sidefx.com]
But I'm failing at the very first instruction, OPgetDirector(), which returns a null pointer.
Is it supposed to be initialized globally when loading the HDK? Do I need to setup one?
Thanks.