Transfer values to another mesh

I have this simple setup here:

As you can see, i store an idx value and a float value.

Now i want to transfer that information to another mesh with the same number of points, but idx should be the index, and float the corresponding value.

So i want this:

id - float
0 - 24.9
1 - 7.2
2 - 51.0
3 - 30.2

i tried this:


but unfortunately this didn’t work.

can anybody explain me why this doesn’t work and how to achieve my goal?

Thank you very much.

Hm, I may be wrong, but I think when we Sample Index, the “index” value is read from the target object.
Here “idx” attribute is on the source object, and doesn’t exist on target. Try to store it on grid mesh instead.

4 Likes

@stray is totally correct.

To do what you want you need to first sample idx using the target index and then use that to sample val.

e.g.

Hope that helped.

2 Likes

thank you both very much for your answer, i tried it (even with idx stored on target) like this:

unfortunately the result isn’t what i have expected:

gn idx problem.blend (1.0 MB)

What did i do wrong?

Ok, i finally found a solution with the help of points to curve node, which does, what i want:

…and after the points to curve i can use “sample index” to get them to the other mesh.

But still i would be curious, why zeroskills/straws proposal didn’t work for me (or what i did wrong)…

Sorry, I assumed you just wanted to consistently map the “generated” indices…

The result you got follows the order of the “generated” indices
image

To get what you want, you can just sort by the “generated” indices…

3 Likes