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