This is a gotcha that has cost people some time
To demonstrate this, I’ve set up a simple point cloud where I Add Points using a grid primitive. I’ve added AttributeDisplay properties to the point cloud, to show the point IDs and PointPositions.
So far, so good. But if I now delete some points, notice how the point IDs don’t change
(there’s none of that “reshuffling” of point IDs that the docs say will happen) . So after I delete every second point, my point IDs are 1, 3, 5, and 7, not 0, 1, 2, and 3.
Consequently, if I use Build Array from Point Data to build an array of point positions, I get the positions for points 0, 1, 2, 3, which is incorrect. For point IDs 0 and 2, all I get is (0,0,0).
The problem is that Point Index to Location returns a valid location
even when I give it the ID of a deleted point (Build Array from Point Data uses Point Index to Location to build the array).
One workaround would be to do something like this in Point Index to Location:
hat tip: Grahame Fuller
“(there’s none of that “reshuffling” of point IDs that the docs say will happen)” : Are you sure the doc say that ? If yes the doc is wrong. Point IDs are unique by definition. This way you always found a specific particle even if you delete other ones with lower ID. To get the Index of the particle, there is the Get Element Index node. Index is not the same that ID. That’s also why in Softimage 2012, the new attributes VertexIndex, PolygonIndex etc… are not called VertexID or PolygonID (thanks to Grahame for this too ;). Because polymesh doesn’t support unique ID and so always reshufle the indices of vertex, poly and edges.
The doc says “point indices”, so I am wrong.
Even the best can be wrong 😉
Hmmm…it seems that like me, Point Index to Location has indices and IDs mixed up.