# How to copy a point's movement to the closest neighbor point?

## Recommended Posts

Hello,

Can you please help me a little bit? Lets say I have 8 points. four them are simulated. You can see them in the green circle. And I have another 4 close to them which are static points? You can see them in the red circles. How can I copy the movement of the animated point to the static points? I tried with attribute transfer in a solver node but I'm sure I made something wrong because it didn't work.

Thank you

Gabor

##### Share on other sites

I don't know what do you mean "transfer the animation", do you want to transfer over the velocity from the point has same name/id attribute and advect the point position by the velocity? If so, you can try something like

```int pt = findattribval(1, "point", "id", @id);

vector vel = point(1, "v", pt);

@P += vel * @TimeInc ;```

So this will grab the velocity attribute from the animated points with the same id attribute. But make sure the four points you want to transfer the velocity.

If you want to grab the nearest point's velocity and advect the point position, you can try something like

```int pt = nearpoint(1,@P);

vector vel = point(1,"v",pt);

@P += vel * @TimeInc ;```

Or you want to constrain your static point to your animated point, that's a slightly complicated case.

Hope this will help.

##### Share on other sites

Thank you for your help. The transfer animation for me  like,  the 4 animated points moving continously. I would like to take that movement and copy to the static points. So the stacis points won't be static anymore and they will move exactly same like the animated points. Maybe I can't explain well but do you get it now?

##### Share on other sites

in a wrangle. Plug static points in to input1 and animated points in to input2

@P = point(1, "P", @ptnum);

##### Share on other sites

Thank you. I will try that.

## Create an account or sign in to comment

You need to be a member in order to leave a comment

## Create an account

Sign up for a new account in our community. It's easy!

Register a new account