Andr

Andr

About Me

専門知識
Not Specified
Location
Not Specified
ウェブサイト

Connect

Recent Forum Posts

WIP - PolyHaven Asset Importer - PHAI - [Houdini Utility] 2022年11月24日10:32

ResilientPictureCompany
Finally managed to finish help doc


congrats for this. And no irony here.
That is the most boring and tiring part.

Fastest method to copy all point attribs given a target ID? 2022年11月24日10:23

animatrix_
For large number of points Attribute Interpolate SOP can crush Attrib Copy in performance. The only issue is that it requires array attributes even if it's only for a single element and weight. RFE submitted: #105259, #124296

So you can create array attributes like this and then use Attribute Interpolate SOP:

i@targetpt = array ( i@targetID );
f@targetweight = array ( 1 );

For 25M points I get about 30% faster performance:

img]https://i.imgur.com/vVUxcUa.png [i.imgur.com]


Thanks for the suggestion, I tried with "Attribute Interpolate Sop" but I'm finding it's very slow compared with "Attribute Copy Sop", even with 20million points. Could you please check the attached file and see if I'm doing something wrong?

In the new file you'll find also a new experimental method: it's a dynamic generation of vex code in Python to transfer the attributes using the simple point(0, "myattrib", i@targetID).
This method seems to be faster than Attribute Copy Sop, with high number of points.
But maybe I just wasted my time, because I'm missing this Attribute Interpolate thing.


Note: I simplified the test scenario, because the earlier version was a bit ambiguous.
I restate the idea: every point is assigned with a unique random targetID, to be used to copy the attributes from another point in the same geo. This produce just a change in the point number, but all the attributes remain in position. So it's like using a "Sort SOP" in random mode.

Fastest method to copy all point attribs given a target ID? 2022年11月23日7:48

My scenario:
All the point attributes in the geometry have their values shuffled.
For example, Point 0 now holds the original attrib values of Point 313, while Point 0 original values are now copied to Point 45, etc.
A i@targetID attribute tells who is the original attributes owner, so that you can use it to copy and restore the original values.
In this case: @targetID for Point 0 is 45, and @targetID for Point 313 is 0;
So to restore the original color attribute I would simply do v@Cd = point(0, "Cd", i@targetID);

But it's a dynamic scenario. I need to copy ALL the point attributes, whose names and types are not known in advance, and can change.
I need to find a solution faster than using Attribute Copy SOP, because that node is too slow.
Going the Vex route, I see that setpointattribute() function is useless here, because it is even slower.

I thought I could use backticks to declare and set dynamically an attribute, but they don't work this way?
// this won't work

string attribName = "Cd";
string attribType = "v";
`attribType`@`attribName` = point(0, attribName, i@targetID);

`attribType`@`attribName` = point(0, attribName, i@targetID);


If anybody wants to give it a try, I prepared a test scenario, with my failed attempt