Jump to content

calculate velocity based on id


Recommended Posts

Hi,

I'm trying to create the v attribute for my points using a Trail SOP. The problem is that the points are deleted and generated, so the point numbers are not the same, and the Trail SOP seems to be using the point numbers. Is there a Trail SOP that matches based on id?

I do have an id attribute per point though. I'm currently using foreach and timeshift SOPs to match points in the previous frame using id, and then calculating the velocity from the positions. This is however very slow. Does anyone have any better ideas?

Edited by chaindriver
Link to comment
Share on other sites

I think you can do with a trail sop, set to compute velocity?

also I think you can also sort points based on ID. check the expression in the sort sop.

point("../NULL1", $PT, id, 0)

I think you potentially will still get changing point numbers as the particles die. but if you have random point numbers on every frame this might make them more stable.

actually this method doesn't work. I see the problem now. even with a sort expression, point numbers change when particles die.

Edited by breadbox
Link to comment
Share on other sites

you can use point SOP for that, it has Match By Attribute Mode

you just need to be careful when the particle is about to die on next frame to set v to 0 or maybe get v from previous frame

here is simple example

Very elegant solution, Tomas. Thanks so much for the hip file, it helped me a lot!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...